Skip to content

Commit 3ce835c

Browse files
rudisimoRudy Puig
andauthored
FEAT: Update Python project (#3)
#### CHANGELOG * chore: update project configuration to meet modern standards * docs: relocate notes and update README * chore: apply formatting rules to entire project * chore: update github workflow to use ruff --------- Co-authored-by: Rudy Puig <[email protected]>
1 parent 051c0bb commit 3ce835c

File tree

20 files changed

+149
-161
lines changed

20 files changed

+149
-161
lines changed

.flake8

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

.github/workflows/build.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
pull_request:
55
branches:
66
- 'main'
7-
push:
8-
branches:
9-
- main
107

118
jobs:
129
build:
@@ -22,14 +19,17 @@ jobs:
2219
uses: actions/setup-python@v5
2320
with:
2421
python-version: ${{ matrix.python-version }}
22+
cache: pip
2523
- name: Install dependencies
2624
run: |
27-
python -m pip install --upgrade pip
28-
pip install .[dev,test]
25+
python -m pip install --quiet --upgrade pip setuptools
26+
python -m pip install --editable '.[dev,test]'
27+
2928
- name: Run linting
30-
run: |
31-
python -m flake8 -v --config .flake8 --black-config pyproject.toml --show-source
3229
continue-on-error: true
30+
run: |
31+
python -m ruff check -q --diff --output-format=full .
32+
python -m ruff format -q --diff --check .
3333
- name: Run unit tests
3434
run: |
3535
python -m pytest -vvv --cov --cov-context=test --cov-report=xml

.pre-commit-config.yaml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
# See https://pre-commit.com for more information
217
# See https://pre-commit.com/hooks.html for more hooks
318
repos:
4-
- repo: https://github.com/PyCQA/autoflake
5-
rev: 'v1.7.8'
6-
hooks:
7-
- id: autoflake
8-
args:
9-
- "--in-place"
10-
11-
- repo: https://github.com/PyCQA/isort
12-
rev: '5.11.5'
13-
hooks:
14-
- id: isort
15-
16-
- repo: https://github.com/psf/black
17-
rev: '22.12.0'
18-
hooks:
19-
- id: black
20-
21-
- repo: https://github.com/PyCQA/flake8
22-
rev: '5.0.4'
23-
hooks:
24-
- id: flake8
25-
2619
- repo: https://github.com/pre-commit/pre-commit-hooks
27-
rev: 'v4.5.0'
20+
rev: 'v4.6.0'
2821
hooks:
2922
- id: trailing-whitespace
3023
- id: end-of-file-fixer
31-
- id: check-yaml
3224
- id: check-ast
3325
- id: check-toml
26+
- id: check-yaml
27+
- repo: https://github.com/astral-sh/ruff-pre-commit
28+
rev: v0.8.2
29+
hooks:
30+
# run the linter
31+
- id: ruff
32+
# run the formatter
33+
- id: ruff-format

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,14 @@ Create a virtual environment:
1313
```bash
1414
python3 -m venv .venv
1515
source .venv/bin/activate
16-
```
17-
18-
Install dependencies:
19-
20-
```bash
2116
python3 -m pip install -U pip setuptools
2217
python3 -m pip install -e '.[test]'
2318
```
2419

25-
Check all answers for 2022:
20+
Check all answers for 2024:
2621

2722
```bash
28-
pytest --cov=. -k 2022
23+
python3 -m pytest --cov=. -k 2024
2924
```
3025

3126
## License
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)