Skip to content
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

Split pre commit config into single executable tasks #37

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install project
run: |
python -m pip install --upgrade pip
pip install '.[dev,examples]'
pip install '.[dev]'

- name: Lint
run: pre-commit run --all-files
run: ruff check
40 changes: 40 additions & 0 deletions .github/workflows/typing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Typing

on:
push:
branches: [ main ]

pull_request:
branches: [ main ]

# Allow job to be triggered manually.
workflow_dispatch:

# Cancel in-progress jobs when pushing to the same branch.
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
typing:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
architecture: x64
cache: pip

- name: Install project
run: |
python -m pip install --upgrade pip
pip install '.[dev]'

- name: Typing
run: |
mypy src --ignore-missing-imports
mypy tests --ignore-missing-imports
18 changes: 0 additions & 18 deletions .pre-commit-config.yaml

This file was deleted.

19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ To run the unit tests:
pytest
```

To format the code:

```shell
ruff format
```

To lint the code:

```shell
ruff check
```

To check typing:

```shell
mypy src --ignore-missing-imports
mypy tests --ignore-missing-imports
```

## Release

To cut a new release of **pyisd** (assuming you have the appropriate permissions):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies = ["click~=8.0", "pandas~=1.3"]
isd = "isd.cli:main"

[project.optional-dependencies]
dev = ["mypy~=1.2", "pre-commit~=3.2", "pytest~=7.4", "ruff~=0.1.9"]
dev = ["mypy~=1.2", "pytest~=7.4", "ruff~=0.1.9"]
examples = ["tqdm~=4.66"]
docs = ["sphinx~=7.2"]

Expand Down