Appearance
Install with Poetry
If you prefer to manage the project with Poetry instead of installing the package directly with pip, follow the steps below. This uses a pyproject.toml file that declares haskoning-retaining-wall as a dependency and points Poetry at the Azure Artifacts feed for you.
Prefer installing directly with
pipinstead? See Install with pip.
Prerequisites
- Python 3.12+
- Access to the Azure DevOps package feed
- A Personal Access Token (PAT) with the Packaging: Read scope
- A virtual environment created and activated
1. Install Poetry
With the virtual environment activated, install Poetry into it:
bash
pip install poetryInstalling Poetry inside the project's virtual environment (rather than globally) keeps it isolated to this project, but a global Poetry installation works too — just make sure your project's virtual environment is still activated when you run
poetry installlater.
2. Create a Personal Access Token (PAT)
Poetry needs a PAT to authenticate against the Azure Artifacts feed:
- In Azure DevOps, go to User Settings → Personal Access Tokens.
- Create a new token with the Packaging: Read scope.
- Copy the token value — you won't be able to view it again after leaving the page.
3. Configure Poetry with your PAT
Register the token with Poetry for the haskoning-py source (this matches the source name declared in pyproject.toml):
bash
poetry config http-basic.haskoning-py azure "<YOUR-PAT>"Replace <YOUR-PAT> with the token you copied in step 3. This stores the credential in Poetry's local configuration so you don't need to re-enter it for future installs on the same machine.
4. Get the project file
Download the pyproject.toml template below and save it into the folder where you have your terminal open (the same folder as your activated .venv):
This file declares haskoning-retaining-wall as a dependency and configures the haskoning-py Azure Artifacts feed as its source:
toml
[project]
name = "retaining-wall"
version = "0.1.0"
description = ""
authors = []
requires-python = ">=3.12,<4"
dependencies = [
"haskoning-retaining-wall (>=0.4.0,<0.9.0)"
]
[tool.poetry]
package-mode = false
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
[[tool.poetry.source]]
name = "haskoning-py"
url = "https://pkgs.dev.azure.com/corporateroot/_packaging/haskoning-py/pypi/simple/"
priority = "supplemental"
[tool.poetry.dependencies]
haskoning-retaining-wall = {source = "haskoning-py"}5. Install the project dependencies
From the same folder, run:
bash
poetry installPoetry reads pyproject.toml, resolves haskoning-retaining-wall against the haskoning-py feed (using the PAT you configured in step 3), and installs it — along with its dependencies — into your active virtual environment.
6. Verify the package was installed
Confirm that haskoning-retaining-wall is present in the environment Poetry created:
bash
poetry run pip show haskoning-retaining-wallThis should print the package's metadata (name, version, location, …). If instead you see a Package(s) not found error, the install did not complete successfully — check the output of poetry install for errors (see Notes below) and re-run it.
Alternatively, you can list all packages Poetry installed into the environment:
bash
poetry showhaskoning-retaining-wall should appear in the list.
Notes
- If
poetry installfails with an authentication error, double-check the PAT has the Packaging: Read scope and hasn't expired, and re-run thepoetry config http-basic.haskoning-py azure "<YOUR-PAT>"command with a fresh token. - The source name in the PAT configuration command (
http-basic.haskoning-py) must match thenameunder[[tool.poetry.source]]inpyproject.tomlexactly. package-mode = falsemeans thispyproject.tomlis set up purely to install and run the package, not to build/publish a package of your own.