forked from cknoll/python-project-template
Directory structure and relevant files for a simple installable python project.
|
CSDUMMI
bcbb461200
Update setup.py for convenience
Reading long description from README.md with type="text/markdown". Added TODOs everywhere that something needs to be adjusted |
||
|---|---|---|
| src/package_name | first commit (template project) | |
| tests | first commit (template project) | |
| .gitignore | first commit (template project) | |
| LICENSE | first commit (template project) | |
| MANIFEST.in | first commit (template project) | |
| README.md | first commit (template project) | |
| requirements.txt | first commit (template project) | |
| setup.py | Update setup.py for convenience | |
General Information
This repository holds the basic directory layout for new python projects. Additional to a reasonable minimum of features (setup.py, requirements.txt, directory structure, ...) it contains the following extras:
- basic unittest
script.pyand associated entrypoint insetup.py(allows to call some functionality of the package directly from command line (trypackage_name cmd1))
Usage
- Rename directory
src/package_name - Edit
setupy.py: replace dummy data with real data. - Add your source. a) Either to
core.pyor b) to your own separate file(s).- a) simplifies importing your module
- b) is more flexible but you have to take care of importability yourself.
For local development it is recommended to install this (better: your) package in editable mode: pip install -e . (run from where setup.py lives).
Publishing on pypi
To publish your package on Python Package Index (pypi) the following commands should work:
python setup.py sdisttwine upload --repository-url https://upload.pypi.org/legacy/ -u <username> dist/*- You need to register a username first.
- There is probably a more modern way for uploading to pypi.