1
0
Fork
You've already forked python-project-template
0
Directory structure and relevant files for a simple installable python project.
  • Python 100%
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
2022年05月03日 19:04:31 +02:00
src/package_name first commit (template project) 2021年07月08日 00:47:57 +02:00
tests first commit (template project) 2021年07月08日 00:47:57 +02:00
.gitignore first commit (template project) 2021年07月08日 00:47:57 +02:00
LICENSE first commit (template project) 2021年07月08日 00:47:57 +02:00
MANIFEST.in first commit (template project) 2021年07月08日 00:47:57 +02:00
README.md first commit (template project) 2021年07月08日 00:47:57 +02:00
requirements.txt first commit (template project) 2021年07月08日 00:47:57 +02:00
setup.py Update setup.py for convenience 2022年05月03日 19:04:31 +02:00

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.