Closed simulkade closed 7 months ago
I admit never having taken the time to figure out how to properly package Python modules for installation with pip
.
I still rely on simply copying the module folder(s) as (a) subfolder(s) for the specific Python calculation/processing job we are working on, importing from the copied folder. This has the advantage that we keep the version of the code that was actually used to produce the results. It is also simple to explain to co-workers and students. For simple, pure scientific Python packages, this works nicely.
For PyFVTool development, I simply work from the repository's root directory, without package installation, which also still works for me. I understood that there exists some special pip
incantation that installs a 'development version' of a package, so that edits are directly integrated.
Suggestions welcome!
I have pip install
working properly, both for regular and development installs. See branch: https://github.com/mhvwerts/PyFVTool/tree/pipfix
PyFVTool can presently be installed from that branch of my fork:
pip install git+https://github.com/mhvwerts/PyFVTool.git@pipfix
This works also from Google Colab, where we can enter the following into the first cell of the Notebook.
!pip install git+https://github.com/mhvwerts/PyFVTool.git@pipfix
I hope to craft a pull request very soon.
P.S. I drew inpiration from
Reference 1 makes a compelling case for putting the module code in a src
directory, which I finally did. This poses no particular problem for development, provided that the development version be installed with pip install -e .
I needed to fix this, since I got complaints from a colleague. Students might use this installation bug as an excuse not to do their homework!
Thanks, @mhvwerts. It looks great. And I know what you mean by not leaving any excuses for students :-).
I tried to install
PyFVTool
in aminiconda
environment usingpip
and laterpython setup.py install
. I received the following error with the former and a similar one with the later although the installation went through the second time. I leave it here for now. It seems that something goes wrong when we have bothpyproject.toml
andsetup.py
.