Directory structure and relevant files for a simple installable python project.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
CSDUMMI bcbb461200 Update setup.py for convenience 4 months ago
src/package_name first commit (template project) 1 year ago
tests first commit (template project) 1 year ago
.gitignore first commit (template project) 1 year ago
LICENSE first commit (template project) 1 year ago
MANIFEST.in first commit (template project) 1 year ago
README.md first commit (template project) 1 year ago
requirements.txt first commit (template project) 1 year ago
setup.py Update setup.py for convenience 4 months ago

README.md

Code style: black

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.py and associated entrypoint in setup.py (allows to call some functionality of the package directly from command line (try package_name cmd1))

Usage

  • Rename directory src/package_name
  • Edit setupy.py: replace dummy data with real data.
  • Add your source. a) Either to core.py or 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 sdist
  • twine 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.