EMAworkbench
EMAworkbench copied to clipboard
Replace setup.py with pyproject.toml and implement optional dependencies
This PR does two things:
- It migrates the project install commands and metadata from
setup.py
topyproject.toml
. It largely follows the convention from setuptools. - It moves the dependencies from
requirements.txt
to thepyproject.toml
file, and thereby also defines a few sets of optional depenencies. Note that many dependencies that were defined in therequirements.txt
are now optional.
This PR succeeds #151 and closes #130.
To-do:
- Migrate to
pyproject.toml
:- [x] Project and Metadata
- [x] Dynamic version
- [x] Dependencies and optional dependencies
- [x] Version
- [x] Packaging
- [x] Update CI to use appropriate install commands for each job
- [x] Update installation docs
- [x] Implement
"all"
extras which installs everything
The installation.rst docs are also updated to reflect the new options for installing extras.
Coverage increased (+0.05%) to 80.051% when pulling 6ca01782f3dde2289841eec28b8a4f2929505806 on pyproject into da65c52401f502ae1bcf409e040e7d10d8c3ec6a on master.
@quaquel One thing still needs to be implemented, and I need a bit of help from you on that. That is the packaing, or what files/directories to include in the package. Currently there is quite a large script for, but I'm sure we could simplify that.
Could you tell me which folders and files need to be exactly included in the package? Then I will take an initial jab at implementing that in the pyproject.toml.
With a bit of reverse engineering I figured it out. :)
The reverse-wildcard trick is brand new and not even documented in Setuptools yet (I found it in a PR, and requested it to be documented in the Data Files Support docs).
@quaquel Ready for review! Please also check the updated installation instructions, and if the right dependencies are assigned to each of the extras.
(please do not merge yet, even if everything looks goods, I want to clean the commits up before merging)
You might have to walk me through all these changes in person. A couple of things
- In the past, I had bad experiences with the automated installation of dependencies. I have seen it brake quite a few anaconda installations. This might be from before
pyproject.toml
so it might no longer be a problem - I am not sure whether we want to break down the dependencies to the degree you have done here. Yes, keeping a light installation can be useful in some cases, but it also creates a possible problem for users that might not fully understand all the configuration options that they have. Again, we can discuss the exact options in person.
- I would not call
["pysd"]
vensim
as is now done in the updated installation instructions. Vensim itself only requires the DSS version and is really a different connector from pysd. I suggest just calling["pysd"]
pysd
.
Thanks for reviewing! I will look into your points, let's walk through them Monday.
Can we do 16:00 by the way? I won't be able to make 15:30.
@quaquel Turns out both JPype and pythonnet crash on other OSes than Windows.
In the latest commit:
- Added
graph
to recommended extra - Removed the connector dependencies from
all
extra - Updated installation.rst docs
On my side it's ready, if you agree, I will clean it up and merge!
@quaquel If you approve I can cleanup and merge, and modify #170 to work with the new setup.
looks good so go ahead