init_contrib
Script to initialize a new contribution by creating a folder with README.md and metadatas.yml files.
create_contribution(name)
Create a new contribution directory with a README.md, metadatas.yml, init.py, code and tests files.
Parameters:
- name (str): The name of the contribution.
Source code in scripts/init_contrib.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
is_valid_contribution_name(name)
Validate the contribution name.
The name must only contain lowercase letters, digits, and underscores.
Args:
- name (str): The contribution name to validate.
Returns:
- bool: True if the name is valid, False otherwise.
Source code in scripts/init_contrib.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
main()
Main entry point of the script.
Accepts the contribution name as a command-line argument, validates it, and creates the necessary files and directory structure in the 'contrib' folder.
Source code in scripts/init_contrib.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |