Pydicer packaging using Poetry #73
dalmouiee
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone, we got pydicer packaged and a test version is up on test PyPi (not the official PyPi platform)
I'll just put here some documentation regarding the setup of the tool we'll use to package Pydicer (called Poetry), and how to use it relevant to this project.
Initial Setup using Poetry:
poetry init
command to initiate the relevant file needed to package pydicer up. A new file is produced by the name "pyproject.toml".poetry add
command to add the necessary dependencies needed for pydicer. These can be found in the "requirements.txt" and "requirements-dev.txt" (for development if needed). With Poetry, you'll need to pass these in one by one through the command line, (eg.poetry add pydicom>=2.1.2 platipy>=0.1.3 ...
). Note: this is done once, when we need to update the dependencies, we use thepoetry update DEPENDENCY_NAME
after the build command is ran and we'll have the ".lock", more about the lock file in step 4.poetry install
command, rather thanpip install -r ...
. If you haven't run install before, then a "poetry.lock" file will be created which will hold the dependencies/their versionings that will be essentially locked to this project. If you have ".lock" file already (which will probably be the case), then the installation will be done by reading it.poetry build
command. 2 files will be generated under the "dist" folder; "pydicer-PIN-py3-none-any.whl". and "pydicer-PIN-.tar.gz". Essentially, we can use one of these 2 files (preferably ".whl") to install pydicer as a package usingpip install ONE_OF_THOSE_FILES
and can be distributed with other users to install locally.poetry build
command can be used and distributed for pydicer installation, it's much tider and better practice that we publish these builds on a public forum like PyPi. To do this, we just need to config some options for publishing onto a platform like PyPi,poetry publish --build --username USERNAME --password PASSWORD
, where USERNAME or PASSWORD are your PyPi credentials.pip install pydicer
Beta Was this translation helpful? Give feedback.
All reactions