diff options
| author | adamjanovsky | 2023-02-04 09:50:54 +0100 |
|---|---|---|
| committer | GitHub | 2023-02-04 09:50:54 +0100 |
| commit | 29ef79f28d0940208b14109c2f39be52aec3a59a (patch) | |
| tree | fff627a63878e69fa0a4cdac70155de9ee671ce6 | |
| parent | 3ed9d4dd94c2e4c4de0d874b65da9c33dec90ec1 (diff) | |
| parent | 3eb2529d876c7f138329d6581b9ea72fafd4004f (diff) | |
| download | sec-certs-29ef79f28d0940208b14109c2f39be52aec3a59a.tar.gz sec-certs-29ef79f28d0940208b14109c2f39be52aec3a59a.tar.zst sec-certs-29ef79f28d0940208b14109c2f39be52aec3a59a.zip | |
Merge pull request #311 from crocs-muni/pin-linter-versions
Pin linter versions
| -rw-r--r-- | .github/workflows/lint.yml | 42 | ||||
| -rw-r--r-- | CONTRIBUTING.md | 7 | ||||
| -rw-r--r-- | pyproject.toml | 13 |
3 files changed, 32 insertions, 30 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 90e4a459..9cb2236f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,40 +3,42 @@ on: push: workflow_dispatch: jobs: - mypy: + black: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Setup python - uses: actions/setup-python@v4 + - uses: actions/setup-python@v4 with: - python-version: "3.9" - - name: Install external dependencies - run: sudo apt-get install build-essential libpoppler-cpp-dev pkg-config python3-dev -y - - name: Install python dependencies + python-version: "3.8" + - name: Install dependencies run: | - pip install -r requirements/requirements.txt + sudo apt-get install build-essential libpoppler-cpp-dev pkg-config python3-dev -y pip install -r requirements/dev_requirements.txt - - name: Run mypy - run: mypy . - black: + - name: Run Black + run: black . --check --target-version py38 + ruff: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: psf/black@stable + - uses: actions/setup-python@v4 with: - version: "23.1.0" - options: "--check --target-version py38" - ruff: + python-version: "3.8" + - name: Install dependencies + run: | + sudo apt-get install build-essential libpoppler-cpp-dev pkg-config python3-dev -y + pip install -r requirements/dev_requirements.txt + - name: Run Ruff + run: ruff . --format=github + mypy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.8" - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install ruff==v0.0.239 - - name: Run Ruff - run: ruff --format=github . + sudo apt-get install build-essential libpoppler-cpp-dev pkg-config python3-dev -y + pip install -r requirements/dev_requirements.txt + - name: Run Mypy + run: mypy . diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3e4c59e0..32f2f0ab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,8 +33,9 @@ Note on single-sourcing the package version: More can be read [here](https://pac ### Currently, the release process is as follows -1. Create a release from GitHub UI. Include release notes, add proper version tag and publish the release (or create it from scratch with new tag). -2. This will automatically update PyPi and DockerHub packages. +1. Update dependencies with `pre-commit autoupdate`, pin new versions of linters into `pyproject.toml` and run `cd requirements && ./compile.sh`. +2. Create a release from GitHub UI. Include release notes, add proper version tag and publish the release (or create it from scratch with new tag). +3. This will automatically update PyPi and DockerHub packages. ## Quality assurance @@ -46,7 +47,7 @@ All commits shall pass the lint pipeline of the following tools: - Ruff (see [pyproject.toml](https://github.com/crocs-muni/sec-certs/blob/main/pyproject.toml) for settings) - PyUpgrade -These tools can be installed via [dev_requirements.txt](https://github.com/crocs-muni/sec-certs/blob/main/dev_requirements.txt) You can use [pre-commit](https://pre-commit.com/) tool register git hook that will evalute these checks prior to any commit and abort the commit for you. Note that the pre-commit is not meant to automatically fix the issues, just warn you. +These tools can be installed via [dev_requirements.txt](https://github.com/crocs-muni/sec-certs/blob/main/dev_requirements.txt) You can use [pre-commit](https://pre-commit.com/) tool to register git hook that will evalute these checks prior to any commit and abort the commit for you. Note that the pre-commit is not meant to automatically fix the issues, just warn you. It should thus suffice to: diff --git a/pyproject.toml b/pyproject.toml index beb1ed33..7406e307 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,9 +62,9 @@ [project.optional-dependencies] dev = [ - "mypy==0.991", "black==23.1.0", "ruff==0.0.239", + "mypy==0.991", "types-PyYAML", "types-python-dateutil", "types-requests", @@ -99,15 +99,12 @@ "F", # pyflakes "C90", # mccabe "UP", # pyupgrade - "PL", # pylint "PTH", # enforce pathlib usage "C4", # comprehensions "SIM", ] ignore = [ - "E501", # line-length, should be handled by black - "PLR2004", # magic numbers, what would a project be without them... - "PLR0913", # too many func arguments + "E501", # line-length, should be handled by black ] src = ["src", "tests"] line-length = 120 @@ -126,19 +123,21 @@ [tool.black] line-length = 120 - exclude = ''' + force-exclude = ''' /( \.git | \.mypy_cache | \.tox | venv - | certsvenv | \.venv | _build | buck-out | build | dist | src/sec_certs/_version.py + | docs + | .ipynb_checkpoints + | .eggs )/ ''' |
