Configure your Python build tool to resolve dependencies through the Lightwell Network repository by adding the repository to your existing configuration.
About this task
Select the configuration method that matches your build tool. Run the command that corresponds to your chosen repository tier.
Procedure
-
If you are using pip:
-
Configure authentication by adding your service account credentials to your
~/.netrc file. Create the file if it does not exist:
machine packages.redhat.com login <service_account_username> password <service_account_token>
where:
<service_account_username>: Specifies your registry service account username in the format XXXXXXX|service-account-name
<service_account_token>: Specifies your registry service account token
-
Run one of the following commands to set the Lightwell Network repository as your default index:
To set the Validated repository as your default index:
$ pip config set global.index-url https://packages.redhat.com/lightwell/python/validated/simple
To set the Remediated repository as your default index:
$ pip config set global.index-url https://packages.redhat.com/lightwell/python/remediated/simple
To set the Predisclosure repository as your default index:
$ pip config set global.index-url https://packages.redhat.com/lightwell/python/predisclosure/simple
-
If you are using Pipenv:
-
Configure authentication by adding your service account credentials to your
~/.netrc file. Create the file if it does not exist:
machine packages.redhat.com login <service_account_username> password <service_account_token>
where:
<service_account_username>: Specifies your registry service account username in the format XXXXXXX|service-account-name
<service_account_token>: Specifies your registry service account token
-
Run one of the following commands to install from the Lightwell Network repository:
To install from the Validated repository:
$ pipenv install --index https://packages.redhat.com/lightwell/python/validated/simple
To install from the Remediated repository:
$ pipenv install --index https://packages.redhat.com/lightwell/python/remediated/simple
To install from the Predisclosure repository:
$ pipenv install --index https://packages.redhat.com/lightwell/python/predisclosure/simple
-
If you are using Poetry:
-
Configure authentication for the Lightwell repository by running the following command:
$ poetry config http-basic.lightwell "<service_account_username>" "<service_account_token>"
where:
<service_account_username>: Specifies your registry service account username in the format XXXXXXX|service-account-name
<service_account_token>: Specifies your registry service account token
-
Run one of the following commands to add the Lightwell Network repository as the default source:
To add the Validated repository:
$ poetry source add --priority=default lightwell https://packages.redhat.com/lightwell/python/validated
To add the Remediated repository:
$ poetry source add --priority=default lightwell https://packages.redhat.com/lightwell/python/remediated
To add the Predisclosure repository:
$ poetry source add --priority=default lightwell https://packages.redhat.com/lightwell/python/predisclosure
-
If you are using uv:
-
Configure authentication by adding your service account credentials to your ~/.netrc file:
Note Create the file if it does not exist. The uv build tool reads credentials from this file.
machine packages.redhat.com login <service_account_username> password <service_account_token>
where:
-
Add one of the following entries to your project's pyproject.toml file to set the Lightwell Network repository as your default index. Setting
default = true replaces the Python Package Index (PyPI):
To set the Validated repository as your default index:
[[tool.uv.index]]
name = "lightwell"
url = "https://packages.redhat.com/lightwell/python/validated/simple"
default = true
To set the Remediated repository as your default index:
[[tool.uv.index]]
name = "lightwell"
url = "https://packages.redhat.com/lightwell/python/remediated/simple"
default = true
To set the Predisclosure repository as your default index:
[[tool.uv.index]]
name = "lightwell"
url = "https://packages.redhat.com/lightwell/python/predisclosure/simple"
default = true
Note To set the same default index for every project, add the entry to ~/.config/uv/uv.toml instead of pyproject.toml, and use [[index]] instead of [[tool.uv.index]].
-
Install the project dependencies:
- Optional:
To install one package without changing the project configuration, run one of the following commands:
To install from the Validated repository:
$ uv pip install --index-url https://packages.redhat.com/lightwell/python/validated/simple <package>
To install from the Remediated repository:
$ uv pip install --index-url https://packages.redhat.com/lightwell/python/remediated/simple <package>
To install from the Predisclosure repository:
$ uv pip install --index-url https://packages.redhat.com/lightwell/python/predisclosure/simple <package>
What to do next
- Create and activate a virtual environment:
$ python3.12 -m venv venv
$ source venv/bin/activate
- Install a package and confirm that it resolves through the Lightwell Network repository:
- To install a specific version, specify the version number in the install command:
$ pip install numpy==2.3.5
- If you are using the Remediated repository, add a remediated dependency and verify that the resolved package version includes the
.rhlw-0000X version suffix. If you are using the Predisclosure repository, add a remediated dependency and verify that the resolved package version includes the .rhlw-0000X-nXXXX version suffix.
$ pip show numpy | grep Version
The output should show a version with the .rhlw-0000X or .rhlw-0000X-nXXXX suffix, for example, Version: 2.3.5.rhlw-00001.