Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 835 Bytes

python_package.md

File metadata and controls

32 lines (26 loc) · 835 Bytes

HOW TO CREATE A PYTHON PACKAGE

  • wheel a package for distribution
    • pip install wheel
    • python setup.py bdist_wheel
    • python setup.py sdist
  • Reorganize and run pytest
    • separate test/src
    • create setup.py
    • create toml file with poetry init
    • create cfg file
    • create requirements.txt file
    • Pip install -e . #install the package
  • Mypy/flake8/autopep8
    • Create requirements_dev.txt
    • Modify setup.cfg for type hinting
    • Touch src/module/py.typed
    • Add configuration options to toml file
    • pip install -r requirements_dev.txt
    • Run mypy src # checks integrity of type hinting
    • Run flake8 src
  • Multiple envs with tax
    • Create tox.ini
  • GitHub actions