Skip to content

Commit 8a72f4c

Browse files
authored
Merge pull request #24 from anikolaienko/feature/upgrade-dependencies-and-fix-ci
Moving away from poetry to simple pip, upgrading all dependencies
2 parents 0f46d1e + 823c52d commit 8a72f4c

22 files changed

+210
-178
lines changed
File renamed without changes.

.code_quality/.flake8

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[flake8]
2+
max-line-length = 120
3+
per-file-ignores =
4+
**/__init__.py:F401,F403
5+
ignore =
6+
; E203 whitespace before ':'
7+
E203
8+
; W503 line break before binary operator
9+
W503
10+
; E704 multiple statements on one line
11+
E704
12+
count = True
File renamed without changes.

code-checks/.mypy.ini renamed to .code_quality/.mypy.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
[mypy]
2-
plugins = sqlalchemy.ext.mypy.plugin
3-
42
disallow_any_generics = True
53
disallow_subclassing_any = True
64
disallow_untyped_calls = True

.flake8

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

.github/workflows/run_code_checks.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Run code checks
33
on:
44
push:
55
branches: [main]
6-
tags:
76
pull_request:
87
branches:
98
- main
@@ -14,28 +13,25 @@ jobs:
1413
runs-on: ubuntu-20.04
1514
strategy:
1615
matrix:
17-
python-version: ["3.8", "3.9", "3.10", "3.11"]
16+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1817

1918
steps:
2019
- name: Checkout
21-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2221

2322
- name: Setup Python
24-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@v5
2524
with:
2625
python-version: ${{ matrix.python-version }}
26+
cache: 'pip'
2727

28-
- name: Install tools
29-
run: pip install -r dev-requirements.txt
30-
31-
- name: Poetry install
32-
run: poetry install
28+
- name: Install dev and test dependencies
29+
run: |
30+
pip install .[dev]
31+
pip install .[test]
3332
3433
- name: Run code quality tools
35-
run: poetry run pre-commit run --all-files
36-
37-
- name: Run unit tests
38-
run: poetry run coverage run -m pytest tests/
34+
run: pre-commit run --all-files
3935

40-
- name: Check unit test coverage
41-
run: poetry run coverage report
36+
- name: Run unit tests & code coverage checks
37+
run: pytest

.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,7 @@ celerybeat.pid
102102
*.sage.py
103103

104104
# Environments
105-
.env
106-
.venv
107-
env/
108-
venv/
109-
ENV/
105+
.venv*
110106
env.bak/
111107
venv.bak/
112108

@@ -130,3 +126,6 @@ dmypy.json
130126

131127
# Coming in future, but not yet
132128
sphinx-docs/
129+
130+
# VS Code IDE
131+
.vscode

.pre-commit-config.yaml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,19 @@
33
files: ".py$"
44
exclude: "sphinx-docs/"
55
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v4.6.0
8+
hooks:
9+
- id: check-merge-conflict
10+
name: Check that merge conflicts are not being committed
11+
- id: trailing-whitespace
12+
name: Remove trailing whitespace at end of line
13+
- id: mixed-line-ending
14+
name: Detect if mixed line ending is used (\r vs. \r\n)
15+
- id: end-of-file-fixer
16+
name: Make sure that there is an empty line at the end
617
- repo: https://github.com/psf/black
7-
rev: 22.10.0
18+
rev: 24.4.2
819
hooks:
920
- id: black
1021
name: black
@@ -13,27 +24,16 @@ repos:
1324
language: python
1425
require_serial: true
1526
types_or: [python, pyi]
16-
args: [--config=code-checks/.black.cfg]
27+
args: [--config=.code_quality/.black.cfg]
1728
- repo: https://github.com/PyCQA/isort
18-
rev: 5.10.1
29+
rev: 5.13.2
1930
hooks:
2031
- id: isort
2132
name: Run isort to sort imports in Python files
2233
files: \.py$|\.pyi$
23-
args: [--settings-path=code-checks/.isort.cfg]
24-
- repo: https://github.com/pre-commit/pre-commit-hooks
25-
rev: v4.3.0
26-
hooks:
27-
- id: check-merge-conflict
28-
name: Check that merge conflicts are not being committed
29-
- id: trailing-whitespace
30-
name: Remove trailing whitespace at end of line
31-
- id: mixed-line-ending
32-
name: Detect if mixed line ending is used (\r vs. \r\n)
33-
- id: end-of-file-fixer
34-
name: Make sure that there is an empty line at the end
34+
args: [--settings-path=.code_quality/.isort.cfg]
3535
- repo: https://github.com/PyCQA/flake8
36-
rev: 5.0.4
36+
rev: 7.0.0
3737
hooks:
3838
- id: flake8
3939
name: flake8
@@ -42,14 +42,14 @@ repos:
4242
language: python
4343
types: [python]
4444
require_serial: true
45-
args: [--config=code-checks/.flake8]
45+
args: [--config=.code_quality/.flake8]
4646
- repo: local
4747
hooks:
4848
- id: mypy
4949
name: mypy
50-
description: 'Optional static typing for Python (installed by Poetry)'
50+
description: 'Optional static typing for Python (installed as [test] dependency)'
5151
entry: mypy
5252
language: python
5353
require_serial: true
5454
types_or: [python, pyi]
55-
args: [--config-file=code-checks/.mypy.ini]
55+
args: [--config-file=.code_quality/.mypy.ini]

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2+
2.0.0 - 2024/05/12
3+
* Moved away from poetry. Changed packaging system using pip, build and twine.
4+
* Upgraded all dependencies.
5+
* Add support for Python 3.12.
6+
* Migrated SQLAlchemy from 1.x to 2.x.
7+
18
1.2.3 - 2022/11/21
29
* Added automated code checks for different Python versions.
310

CONTRIBUTING.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@ Table of Contents:
77
- [Run tests](#run-tests)
88

99
# Dev environment
10-
* Install prerequisites from `dev-requirements.txt`:
10+
* Install all dependencies:
1111
```bash
12-
pip install -r dev-requirements.txt
13-
```
14-
* Install `py-automapper` dependencies with poetry:
15-
```bash
16-
poetry install
12+
pip install .[dev]
13+
pip install .[test]
1714
```
1815

1916
# Pre-commit
@@ -23,18 +20,19 @@ pre-commit install
2320
```
2421
After this code checks will run on `git commit` command.
2522

26-
If some of the `pre-commit` dependencies are not found make sure to activate appropriate poetry virtualenv. To check path to virtual environment run:
27-
```bash
28-
poetry env info -p
29-
```
23+
If some of the `pre-commit` dependencies are not found make sure to activate appropriate virtual environment
3024

31-
Or run pre-commit manually:
32-
```
33-
poetry run pre-commit run --all-files
25+
To run `pre-commit` manually use:
26+
```bash
27+
pre-commit run --all-files
3428
```
3529

3630
# Run tests
3731
To run unit tests use command:
32+
```bash
33+
make test
3834
```
39-
poetry run pytest tests/
35+
or simply
36+
```bash
37+
pytest
4038
```

0 commit comments

Comments
 (0)