Python module development workflow - setup and build

I am writing my first python module and I'm curious about logistics: specifically how people are installing / assembling.

Is it standard practice to start with all things distutils in place and in virtualenv to run setup.py for each modification and test, etc.?

Are people more likely to create working code and then worry about converting it into a redistributable package?

A very specific example: my code should access a data file. Should I just hardcode the file address, i.e. DATA_FILE_PATH = "./data/DATA.npz" , or should I figure out how to use all these things MANIFEST.in / setup(..., package_data={ ... }, ...) from the very beginning?


Edit: this amazing answer from @LukasGraf gives some fantastic workflow information that pretty much answers my questions. Please give him a little support!

+6
source share
1 answer

This page ( http://docs.python-guide.org/en/latest/writing/structure/ ) contains some great recommendations for one common approach to this.

Then seriously look at the cookie cutter at https://github.com/audreyr/cookiecutter to quickly set up your directory structure.

Also consider reading on virtualenv and virtualenv-wrapper at https://virtualenvwrapper.readthedocs.org/

+4
source

Source: https://habr.com/ru/post/979412/


All Articles