Skip to content

Commit c9e393b

Browse files
Pip lock
1 parent 5ce1eea commit c9e393b

7 files changed

Lines changed: 673 additions & 7 deletions

File tree

.github/workflows/main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,26 @@ jobs:
3131
- name: Run linter
3232
run: make lint
3333

34+
lock-check:
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
python-version: [3.11]
39+
os: [ubuntu-latest]
40+
runs-on: ${{ matrix.os }}
41+
steps:
42+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
43+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
- name: Install pip-tools
47+
run: pip install pip-tools
48+
- name: Check lock files are in sync
49+
run: |
50+
make lock
51+
git diff --exit-code requirements.txt requirements-dev.txt requirements-jupyter.txt || \
52+
(echo "Lock files are out of sync with pyproject.toml. Run 'make lock' and commit." && exit 1)
53+
3454
license-check:
3555
strategy:
3656
fail-fast: false

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,24 @@ Follow the [NetworkX documentation guidelines](https://networkx.org/documentatio
5757

5858

5959

60+
## Dependency Management
61+
62+
This project uses [pip-tools](https://pip-tools.readthedocs.io/) to pin dependencies for reproducible builds. Top-level dependencies are declared in `pyproject.toml`, and exact versions are locked in:
63+
64+
| Lock file | Contents |
65+
|---|---|
66+
| `requirements.txt` | Core dependencies |
67+
| `requirements-dev.txt` | Test + developer dependencies |
68+
| `requirements-jupyter.txt` | Jupyter notebook dependencies |
69+
70+
When adding or changing a dependency:
71+
72+
1. Edit `pyproject.toml` with the new dependency or version range.
73+
2. Run `make lock` to regenerate the lock files.
74+
3. Run `make install-dev` to update your local environment.
75+
4. Commit both `pyproject.toml` and the updated lock files.
76+
77+
6078
## Code of Conduct
6179
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
6280
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,23 @@ show: ## Show the current environment.
2323
install: ## Install the project for examples.
2424
@if [ "$(USING_POETRY)" ]; then poetry install && exit; fi
2525
@echo "Don't forget to run 'make virtualenv' if you got errors."
26-
$(ENV_PREFIX)pip install -e .[jupyter]
26+
$(ENV_PREFIX)pip install -r requirements-jupyter.txt
27+
$(ENV_PREFIX)pip install -e . --no-deps
2728

2829
.PHONY: install-dev
29-
install-dev: install ## Install the project in dev mode.
30+
install-dev: ## Install the project in dev mode.
3031
@if [ "$(USING_POETRY)" ]; then poetry install && exit; fi
3132
@echo "Don't forget to run 'make virtualenv' if you got errors."
32-
$(ENV_PREFIX)pip install -e .[test,developer]
33+
$(ENV_PREFIX)pip install -r requirements-dev.txt
34+
$(ENV_PREFIX)pip install -e . --no-deps
3335

3436

37+
.PHONY: lock
38+
lock: ## Regenerate lock files from pyproject.toml.
39+
$(ENV_PREFIX)pip-compile pyproject.toml -o requirements.txt --strip-extras
40+
$(ENV_PREFIX)pip-compile pyproject.toml --extra test --extra developer -o requirements-dev.txt --strip-extras
41+
$(ENV_PREFIX)pip-compile pyproject.toml --extra jupyter -o requirements-jupyter.txt --strip-extras
42+
3543
.PHONY: dist
3644
dist: ## install the distribution
3745
@echo "Building distribution:"

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,27 @@ python -m pip wheel -w dist .
3333
pip install "dist/nx_neptune-0.5.0-py3-none-any.whl"
3434
```
3535

36-
### Installation
37-
38-
To install the required nx_neptune dependencies:
36+
### Install from source
3937

4038
```bash
4139
git clone git@github.com:awslabs/nx-neptune.git
4240
cd nx-neptune
4341

44-
# install from source directly
42+
# Create and activate a virtual environment
43+
make virtualenv
44+
source .venv/bin/activate
45+
46+
# Install from source (uses pinned lock files for reproducible builds)
4547
make install
48+
49+
# For development (includes test and linting tools)
50+
make install-dev
51+
```
52+
53+
Dependencies are pinned in lock files (`requirements.txt`, `requirements-dev.txt`, `requirements-jupyter.txt`) generated by [pip-tools](https://pip-tools.readthedocs.io/). If you update `pyproject.toml`, regenerate them with:
54+
55+
```bash
56+
make lock
4657
```
4758

4859
## Prerequisite

requirements-dev.txt

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.13
3+
# by the following command:
4+
#
5+
# pip-compile --extra=developer --extra=test --output-file=requirements-dev.txt --strip-extras pyproject.toml
6+
#
7+
alabaster==1.0.0
8+
# via sphinx
9+
babel==2.18.0
10+
# via sphinx
11+
black==26.3.1
12+
# via nx-neptune (pyproject.toml)
13+
boto3==1.42.87
14+
# via nx-neptune (pyproject.toml)
15+
botocore==1.42.87
16+
# via
17+
# boto3
18+
# s3transfer
19+
certifi==2026.2.25
20+
# via
21+
# opensearch-py
22+
# requests
23+
cfgv==3.5.0
24+
# via pre-commit
25+
charset-normalizer==3.4.7
26+
# via requests
27+
click==8.3.2
28+
# via black
29+
coverage==7.13.5
30+
# via pytest-cov
31+
cymple==0.12.0
32+
# via nx-neptune (pyproject.toml)
33+
distlib==0.4.0
34+
# via virtualenv
35+
docutils==0.22.4
36+
# via sphinx
37+
dotenv==0.9.9
38+
# via nx-neptune (pyproject.toml)
39+
events==0.5
40+
# via opensearch-py
41+
filelock==3.25.2
42+
# via
43+
# python-discovery
44+
# virtualenv
45+
flake8==7.3.0
46+
# via flake8-pyproject
47+
flake8-pyproject==1.2.4
48+
# via nx-neptune (pyproject.toml)
49+
grpcio==1.80.0
50+
# via opensearch-protobufs
51+
identify==2.6.18
52+
# via pre-commit
53+
idna==3.11
54+
# via requests
55+
imagesize==2.0.0
56+
# via sphinx
57+
iniconfig==2.3.0
58+
# via pytest
59+
isort==8.0.1
60+
# via nx-neptune (pyproject.toml)
61+
jinja2==3.1.6
62+
# via sphinx
63+
jmespath==1.1.0
64+
# via
65+
# boto3
66+
# botocore
67+
librt==0.9.0
68+
# via mypy
69+
markupsafe==3.0.3
70+
# via jinja2
71+
mccabe==0.7.0
72+
# via flake8
73+
mypy==1.20.0
74+
# via nx-neptune (pyproject.toml)
75+
mypy-extensions==1.1.0
76+
# via
77+
# black
78+
# mypy
79+
networkx==3.6.1
80+
# via nx-neptune (pyproject.toml)
81+
nodeenv==1.10.0
82+
# via pre-commit
83+
numpy==2.4.4
84+
# via
85+
# nx-neptune (pyproject.toml)
86+
# pandas
87+
# scipy
88+
opensearch-protobufs==0.19.0
89+
# via opensearch-py
90+
opensearch-py==3.1.0
91+
# via nx-neptune (pyproject.toml)
92+
packaging==26.0
93+
# via
94+
# black
95+
# pytest
96+
# sphinx
97+
pandas==3.0.2
98+
# via nx-neptune (pyproject.toml)
99+
pathspec==1.0.4
100+
# via
101+
# black
102+
# mypy
103+
pip-licenses==5.5.5
104+
# via nx-neptune (pyproject.toml)
105+
platformdirs==4.9.6
106+
# via
107+
# black
108+
# python-discovery
109+
# virtualenv
110+
pluggy==1.6.0
111+
# via
112+
# pytest
113+
# pytest-cov
114+
pre-commit==4.5.1
115+
# via nx-neptune (pyproject.toml)
116+
prettytable==3.17.0
117+
# via pip-licenses
118+
protobuf==7.34.1
119+
# via opensearch-protobufs
120+
pycodestyle==2.14.0
121+
# via flake8
122+
pyflakes==3.4.0
123+
# via flake8
124+
pygments==2.20.0
125+
# via
126+
# pytest
127+
# sphinx
128+
pytest==9.0.3
129+
# via
130+
# nx-neptune (pyproject.toml)
131+
# pytest-asyncio
132+
# pytest-cov
133+
# pytest-order
134+
pytest-asyncio==1.3.0
135+
# via nx-neptune (pyproject.toml)
136+
pytest-cov==7.1.0
137+
# via nx-neptune (pyproject.toml)
138+
pytest-order==1.3.0
139+
# via nx-neptune (pyproject.toml)
140+
python-dateutil==2.9.0.post0
141+
# via
142+
# botocore
143+
# opensearch-py
144+
# pandas
145+
python-discovery==1.2.2
146+
# via virtualenv
147+
python-dotenv==1.2.2
148+
# via dotenv
149+
pytokens==0.4.1
150+
# via black
151+
pyyaml==6.0.3
152+
# via pre-commit
153+
requests==2.33.1
154+
# via
155+
# opensearch-py
156+
# sphinx
157+
roman-numerals==4.1.0
158+
# via sphinx
159+
s3transfer==0.16.0
160+
# via boto3
161+
scipy==1.17.1
162+
# via nx-neptune (pyproject.toml)
163+
six==1.17.0
164+
# via python-dateutil
165+
snowballstemmer==3.0.1
166+
# via sphinx
167+
sphinx==9.1.0
168+
# via nx-neptune (pyproject.toml)
169+
sphinxcontrib-applehelp==2.0.0
170+
# via sphinx
171+
sphinxcontrib-devhelp==2.0.0
172+
# via sphinx
173+
sphinxcontrib-htmlhelp==2.1.0
174+
# via sphinx
175+
sphinxcontrib-jsmath==1.0.1
176+
# via sphinx
177+
sphinxcontrib-qthelp==2.0.0
178+
# via sphinx
179+
sphinxcontrib-serializinghtml==2.0.0
180+
# via sphinx
181+
sqlglot==30.4.2
182+
# via nx-neptune (pyproject.toml)
183+
typing-extensions==4.15.0
184+
# via
185+
# grpcio
186+
# mypy
187+
urllib3==2.6.3
188+
# via
189+
# botocore
190+
# opensearch-py
191+
# requests
192+
virtualenv==21.2.1
193+
# via pre-commit
194+
wcwidth==0.6.0
195+
# via prettytable

0 commit comments

Comments
 (0)