Skip to content

Commit 555bb8d

Browse files
authored
Move development dependencies to pyproject.toml (#64)
Minor PR to kick-off contributing to `torchfix`. I'm developing new functionality, which I plan to contribute in follow-up PRs. Changes: - Move `requirements-dev.txt` to `optional-dependencies` - Explicitly set the setuptools build system - Omit `pip install pre-commit` in CONTRIBUTING.md, already included in dev dependencies
1 parent 8aef63b commit 555bb8d

File tree

5 files changed

+31
-18
lines changed

5 files changed

+31
-18
lines changed

.github/workflows/test-torchfix.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ jobs:
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v4
13-
- name: Install requirements
13+
- name: Upgrade build dependencies
1414
run: |
15-
pip3 install -r requirements-dev.txt
15+
pip3 install -U pip
16+
pip3 install -U setuptools
1617
- name: Install TorchFix
1718
run: |
18-
pip3 install .
19+
pip3 install ".[dev]"
1920
- name: Run pytest
2021
run: |
2122
pytest tests

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ We actively welcome your pull requests.
2020

2121
## Linting
2222

23-
We use `black`, `flake8`, and `mypy` to lint the code.
24-
```
25-
pip install -r requirements-dev.txt
23+
We use `black`, `flake8`, and `mypy` to lint the code. Configuration is available to run lints via `pre-commit`.
24+
25+
```shell
26+
pip install ".[dev]"
2627
```
2728

2829
Linting via pre-commit hook:
29-
```
30-
# install pre-commit hooks for the first time
31-
pre-commit install
3230

31+
```shell
3332
# manually run pre-commit hooks on all files (runs all linters)
3433
pre-commit run --all-files
3534
```
3635

3736
Manually running individual linters:
38-
```
37+
38+
```shell
3939
black .
4040
flake8
4141
mypy .

pyproject.toml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[build-system]
2+
requires = ["setuptools >= 65.0"]
3+
build-backend = "setuptools.build_meta"
4+
15
[project]
26
name = "TorchFix"
37
requires-python = ">=3.9"
@@ -9,7 +13,22 @@ classifiers = [
913
"Programming Language :: Python"
1014
]
1115
dynamic = ["version"]
12-
dependencies = ["flake8>=3.8.2", "PyYAML", "libcst>=1.1.0,<1.2.0"]
16+
dependencies = [
17+
"flake8>=3.8.2",
18+
"PyYAML",
19+
"libcst>=1.1.0,<1.2.0"
20+
]
21+
22+
[project.optional-dependencies]
23+
dev = [
24+
"flake8==6.0.0",
25+
"pytest==7.2.0",
26+
"libcst==1.1.0",
27+
"types-PyYAML==6.0.7",
28+
"mypy==1.7.0",
29+
"black==24.4.0",
30+
"pre-commit==3.7.0",
31+
]
1332

1433
[project.urls]
1534
Repository = "https://github.com/pytorch-labs/torchfix"

requirements-dev.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

torchfix/visitors/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)