@@ -13,6 +13,9 @@ A library and a command line interface for the CVE Services API.
1313
1414### Linux, MacOS, Windows
1515
16+
17+ #### pip
18+
1619``` bash
1720python3 -m pip install --user cvelib
1821```
@@ -32,6 +35,20 @@ To resolve this error, add the file path for where your `cve.exe` file resides (
3235` C:\Users\<username>\AppData\Roaming\Python\Python39\Scripts ` ) to your ` PATH ` variable. You can
3336edit your environment variables by searching * Edit the system environment variables* from the Start menu.
3437
38+ #### uv
39+
40+ To run the ` cve ` command using [ uvx] ( https://docs.astral.sh/uv/guides/tools/ ) , execute:
41+
42+ ```
43+ uvx --from cvelib cve --help
44+ ```
45+
46+ or to install it, execute:
47+
48+ ```
49+ uv tool install cvelib
50+ ```
51+
3552### Podman/Docker
3653
3754You can fetch a specific version of the ` cvelib ` library installed in a container image at
@@ -241,61 +258,66 @@ For more information, see the individual methods defined in the
241258
242259## Development Setup
243260
261+ [ uv] ( https://github.com/astral-sh/uv ) is the recommended tool for local development:
262+
263+ ``` bash
264+ git clone https://github.com/RedHatProductSecurity/cvelib.git && cd cvelib
265+ uv sync --dev
266+ ```
267+
268+ The ` uv sync --dev ` command will:
269+ - Create a virtual environment in ` .venv/ `
270+ - Install the project in editable mode
271+ - Install all development dependencies (test, dev groups)
272+
273+ To run all of the below commands without ` uv run ` , activate the virtual environment:
274+
244275``` bash
245- git clone https://github.com/RedHatProductSecurity/cvelib.git
246- cd cvelib
247- python3 -m venv venv
248- source venv/bin/activate
249- pip install --upgrade pip
250- pip install -e .
251- pip install tox
252- # If you want to use any of the dev dependencies outside of Tox, you can install them all with:
253- pip install -e .[dev]
276+ source .venv/bin/activate
254277```
255278
256279To enable command autocompletion when using a virtual environment, add the line noted in ` Command Autocompletion `
257- above to your ` venv/bin/activate ` file, for example :
280+ above to your virtual environment's activate file :
258281
259282``` bash
260- echo ' eval "$(_CVE_COMPLETE=bash_source cve)"' >> venv/bin/activate
283+ echo ' eval "$(_CVE_COMPLETE=bash_source cve)"' >> . venv/bin/activate
261284```
262285
263286This project uses [ ruff formatter] ( https://docs.astral.sh/ruff/formatter/ ) for code formatting.
264287To reformat the entire code base after you make any changes, run:
265288
266289``` bash
267- ruff format .
290+ uv run ruff format .
268291```
269292
270293To sort all imports using [ ruff's import sorting] ( https://docs.astral.sh/ruff/rules/#isort-i ) , run:
271294
272295``` bash
273- ruff check --select I --fix .
296+ uv run ruff check --select I --fix .
274297```
275298
276299Running tests and linters:
277300
278301``` bash
279302# Run all tests and format/lint checks (also run as a Github action)
280- tox
303+ uv run tox
281304# Run lint check only
282- tox -e ruff-lint
305+ uv run tox -e ruff-lint
283306# Run format check only
284- tox -e ruff-format
307+ uv run tox -e ruff-format
285308# Run tests using a specific version of Python
286- tox -e py313
309+ uv run tox -e py313
287310# Run a single test using a specific version of Python
288- tox -e py313 -- tests/test_cli.py::test_cve_show
311+ uv run tox -e py313 -- tests/test_cli.py::test_cve_show
289312```
290313
291314Any changes in the commands, their options, or help texts must be reflected in the generated man pages. To refresh
292315them, run:
293316
294317``` bash
295- pip install click-man
296- click-man cve
318+ uv run click-man cve
297319# OR
298- tox -e manpages
320+ uv run tox -e manpages
299321```
300322
301323---
0 commit comments