-
Notifications
You must be signed in to change notification settings - Fork 73
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
Convert the project from setuptools -> poetry #52
Conversation
Codecov Report
@@ Coverage Diff @@
## master #52 +/- ##
=======================================
Coverage 81.00% 81.00%
=======================================
Files 5 5
Lines 416 416
Branches 88 88
=======================================
Hits 337 337
Misses 60 60
Partials 19 19 Continue to review full report at Codecov.
|
@kquerna I would love to get your input on the updates to the contributing docs here. 😄 |
RUN python -m venv /venv | ||
|
||
COPY pyproject.toml poetry.lock ./ | ||
RUN poetry export -f requirements.txt | /venv/bin/pip install -r /dev/stdin | ||
|
||
COPY . . | ||
RUN poetry build && /venv/bin/pip install dist/*.whl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why we are going this route, rather than just using poetry install
and poetry build
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here is that we ship a final image with none of the build artifacts; only the finally installed product. If you notice, poetry is not installed into the venv, and so doesn't actually get copied over to the final image. Same with the -dev
packages installed on line 12. The main goal here is to provide as compact and clean an image as we can.
So with all of that in mind, the easiest way to get Poetry to use the Python interpreter in the venv, is to do this export and pip install.
Of course, all this is adapted from a number of examples I've found online. So I'd be happy if somebody is able to help build a better way!
``` | ||
Now, setting up a development environment is super simple! | ||
|
||
Step 1: [Install Poetry] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider including a link on how to install poetry?
https://python-poetry.org/docs/#installation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this? 😄
Convert the project from setuptools -> poetry
Backport #52 -- switch from setuptools -> poetry
This sets us up with Poetry instead of setuptools. This way we actually have a legit package manager, dev environment manager, deterministic builds, etc etc etc.
Steps for this to be considered complete:
setup.cfg
pyproject.toml
where possiblepyproject.coml
where possibleI'm pretty sure that's all that's left... I will add any other things here which pop up.