adobe-apiplatform / umapi-client.py

Python client for the User Management API (UMAPI) from Adobe
https://developer.adobe.com/umapi/
MIT License
12 stars 19 forks source link

Switch from setup.py to Poetry #90

Closed adorton-adobe closed 3 years ago

adorton-adobe commented 3 years ago

I would like to move the project to Poetry to make dependency and environment management easier. Better dependency tracking is especially critical in light of https://github.com/adobe-apiplatform/user-sync.py/issues/692 which seems to be related to changes in the UST dependency graph. If we had adopted Poetry or a similar dependency management system sooner, we'd be able to inspect the lockfile or look at the dependency graph to figure out what may have changed.

$ poetry show --tree
cryptography 3.3.2 cryptography is a package which provides cryptographic recipes and primitives to Python developers.
├── cffi >=1.12
│   └── pycparser *
└── six >=1.4.1
pyjwt 2.0.1 JSON Web Token implementation in Python
requests 2.25.1 Python HTTP for Humans.
├── certifi >=2017.4.17
├── chardet >=3.0.2,<5
├── idna >=2.5,<3
└── urllib3 >=1.21.1,<1.27

We'll probably adopt Poetry for the UST but umapi-client is a good pilot project.

To test this change, Poetry must be installed. It serves as the entrypoint to build the package and manage dependencies.

# install project dependencies to virtual environment
$ poetry install

# after install, run tests
$ poetry run pytest

# build wheel and sdist
$ poetry build

# add a dependency to pyproject.toml as well as virtual environment
$ poetry add x