Skip to content

Move development dependencies to pyproject.toml #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/test-torchfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install requirements
- name: Upgrade build dependencies
run: |
pip3 install -r requirements-dev.txt
pip3 install -U pip
pip3 install -U setuptools
- name: Install TorchFix
run: |
pip3 install .
pip3 install ".[dev]"
- name: Run pytest
run: |
pytest tests
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ We actively welcome your pull requests.

## Linting

We use `black`, `flake8`, and `mypy` to lint the code.
```
pip install -r requirements-dev.txt
We use `black`, `flake8`, and `mypy` to lint the code. Configuration is available to run lints via `pre-commit`.

```shell
pip install ".[dev]"
```

Linting via pre-commit hook:
```
# install pre-commit hooks for the first time
pre-commit install

```shell
# manually run pre-commit hooks on all files (runs all linters)
pre-commit run --all-files
```

Manually running individual linters:
```

```shell
black .
flake8
mypy .
Expand Down
21 changes: 20 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["setuptools >= 65.0"]
build-backend = "setuptools.build_meta"

[project]
name = "TorchFix"
requires-python = ">=3.9"
Expand All @@ -9,7 +13,22 @@ classifiers = [
"Programming Language :: Python"
]
dynamic = ["version"]
dependencies = ["flake8>=3.8.2", "PyYAML", "libcst>=1.1.0,<1.2.0"]
dependencies = [
"flake8>=3.8.2",
"PyYAML",
"libcst>=1.1.0,<1.2.0"
]

[project.optional-dependencies]
dev = [
"flake8==6.0.0",
"pytest==7.2.0",
"libcst==1.1.0",
"types-PyYAML==6.0.7",
"mypy==1.7.0",
"black==24.4.0",
"pre-commit==3.7.0",
]

[project.urls]
Repository = "https://github.com/pytorch-labs/torchfix"
Expand Down
7 changes: 0 additions & 7 deletions requirements-dev.txt

This file was deleted.

Empty file added torchfix/visitors/__init__.py
Empty file.