Skip to content

Commit

Permalink
generate requirements.txt and add docs (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeifer authored Mar 29, 2023
1 parent 2a16699 commit a7b5ac9
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Configure your virtual environment of choice with Python >=3.11.
Install the project and its dependencies to your virtual environment with pip:

```commandline
pip install -r requirements.txt'
pip install -e '.[dev]'
```

Expand All @@ -29,3 +30,27 @@ pre-commit checks, this can be done with:
```commandline
git commit -m "message" --no-verify
```

## Adding/updating dependencies

### Updating `requirements.txt` to latest versions

All dependencies should be specified in the project's `pyproject.toml`. The
frozen `requirements.txt` file is generated from that list using the
`pip-compile` utility (from the dev dependency `pip-tools`). Simply run:

```commandline
pip-compile
```

### Updating package pinning

To change a package minimum or maximum version, edit the pinning specified in
`pyproject.toml` then run `pip-compile` as above.


### Adding a new package

To add a new package as a project dependency, edit the `pyproject.toml` and add
it to the corresponding dependeny list. Run `pip-compile` as above to update
`requirements.txt` with the new package.
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ classifiers = [
"Programming Language :: Python :: 3",
]
dependencies = [
"fastapi",
"fastapi >=0.95.0",
"uvicorn >=0.20.0",
]
dynamic = [
"version",
Expand All @@ -32,12 +33,12 @@ dynamic = [

[project.optional-dependencies]
dev = [
"uvicorn >=0.20.0",
"pre-commit >=3.1.1",
"pre-commit-hooks >=4.4.0",
"black >=23.1.0",
"ruff >=0.0.253",
"mypy >=1.0.1",
"pip-tools >= 6.12.3",
"pyupgrade >=3.3.1",
]

Expand Down
26 changes: 26 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile
#
anyio==3.6.2
# via starlette
click==8.1.3
# via uvicorn
fastapi==0.95.0
# via swoop (pyproject.toml)
h11==0.14.0
# via uvicorn
idna==3.4
# via anyio
pydantic==1.10.7
# via fastapi
sniffio==1.3.0
# via anyio
starlette==0.26.1
# via fastapi
typing-extensions==4.5.0
# via pydantic
uvicorn==0.21.1
# via swoop (pyproject.toml)

0 comments on commit a7b5ac9

Please sign in to comment.