-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace custom build system with Poetry #563
Comments
Sure, let's pursue this. The main wrinkle is reproducible Docker builds, which may just mean adding a poetry export -f requirements.txt -o requirements.txt step (https://pythonspeed.com/articles/pipenv-docker/)? some more context that informed my initial decision wrt |
OK, thanks. I was under the impression having the
Based on that, I don't think a I briefly skimmed the first link in your message and saw that the introduction of a |
I'll take a crack at this tonight. I don't think I'll finish tonight, but I think I'll at least come away with more knowledge about what will be involved with making this switch. |
I've run into my first hiccup: incompatible ("contradictory") requirements (you can ignore the yellow line about the broken pre-existing environment). I don't know whether this also happens with the current build system and I just haven't noticed it, or it is unique to either Poetry or the version specifiers I ended up with in the mkdocs-mermaid2-plugin = "^1.2.1"
# ...
nmdc-schema = "==11.1.0" Anyway, I'll try to resolve it. I see that |
I resolved that one by updating the version constraint to: # Note: The specification for the latest version of this package is (currently) `^1.2.1`. The reason we
# are specifying an older version is that we also depend on `nmdc-schema==11.1.0`, which specifies
# that older version as one of its production dependencies.
#
# TODO: Inquire with `nmdc-schema` maintainers about addressing their dependence upon the
# old version of this package.
#
mkdocs-mermaid2-plugin = ">=0.6.0, <0.7.0" For reference, the
However, after making that change, when I re-ran There may be additional conflicts beyond this second one. I do not plan to post about each additional on in a comment here. I am noting them in comments in the |
Yahoo! There were only 1-2 additional conflicts and they are all resolved now. Poetry has generated its |
I created a draft PR (linked above by GitHub) containing the |
The PR is continuing to take shape. All the GitHub Actions workflows are passing again (with Poetry in the mix and the |
Background
Currently, the Runtime uses a custom dependency management solution that works something like this:
requirements/*.in
file:main.in
for production dependencies anddev.in
for development dependencies$ make update-deps
, which — under the hood — runs these commands, which update themain.txt
anddev.txt
filesnmdc-runtime/Makefile
Lines 6 to 16 in f0e8096
$ make init
, which — under the hood — runs these commands, which install the packages listed inmain.txt
anddev.txt
into the current Python environmentPros:
Cons:
Proposal
Switch to using Poetry.
If the Runtime used Poetry, the above process would become:
pyproject.toml
file (there are different sections of the file for production versus development dependencies)$ poetry install
to install the packages listed in the file — this will generate apoetry.lock
file if one doesn't already exist (commit this file to the repo once it exists)The text was updated successfully, but these errors were encountered: