Skip to content

Commit 2e379c8

Browse files
authored
Merge pull request #155 from olirice/or/modernize-tooling
Modernize Tooling: pyproject.toml + poetry
2 parents 43ec10f + 55066a3 commit 2e379c8

File tree

8 files changed

+101
-29
lines changed

8 files changed

+101
-29
lines changed

.github/workflows/pre-commit_hooks.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ jobs:
1515
with:
1616
python-version: '3.10'
1717

18-
- name: install pre-commit
18+
- name: Install Poetry
1919
run: |
20-
python -m pip install --upgrade pip
21-
pip install pre-commit
20+
curl -sSL https://install.python-poetry.org | python3 -
21+
export PATH="$HOME/.local/bin:$PATH"
2222
23+
- name: Install Dependencies
24+
run: |
25+
poetry install
2326
24-
- name: run pre-commit hooks
27+
- name: Run Pre-commit Hooks
2528
run: |
26-
pre-commit run --all-files
29+
poetry run pre-commit run --all-files

.github/workflows/test.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: ['3.8', '3.11']
11-
postgres-version: ['13', '14', '15']
12-
sqlalchemy-version: ['1.4', '2.0']
10+
python-version: ['3.9', '3.13']
11+
postgres-version: ['13', '17']
1312

1413
services:
1514

@@ -31,16 +30,18 @@ jobs:
3130
with:
3231
python-version: ${{ matrix.python-version }}
3332

34-
- name: Install
33+
- name: Install Poetry
3534
run: |
36-
pip install --upgrade pip
37-
pip install wheel
38-
pip install -e ".[dev]"
39-
pip install "sqlalchemy==${{ matrix.sqlalchemy-version }}"
35+
curl -sSL https://install.python-poetry.org | python3 -
36+
export PATH="$HOME/.local/bin:$PATH"
37+
38+
- name: Install Dependencies
39+
run: |
40+
poetry install
4041
4142
- name: Test with Coverage
4243
run: |
43-
pytest --cov=alembic_utils src/test --cov-report=xml
44+
poetry run pytest --cov=alembic_utils src/test --cov-report=xml
4445
4546
- name: Upload coverage to Codecov
4647
uses: codecov/codecov-action@v1

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ __pycache__/
99
# vim
1010
*.swp
1111

12+
# mac
13+
.DS_Store
14+
1215
# Distribution / packaging
1316
.Python
1417
build/
@@ -30,6 +33,9 @@ share/python-wheels/
3033
*.egg
3134
MANIFEST
3235

36+
# poetry
37+
poetry.lock
38+
3339
# PyInstaller
3440
# Usually these files are written by a python script from a template
3541
# before PyInstaller builds the exe, so as to inject date/other infos into it.

.isort.cfg

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

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ repos:
3636
hooks:
3737
- id: mypy
3838
files: src/
39-
args: ["--config-file", "mypy.ini"]
39+
args: ["--config-file=pyproject.toml"]

mypy.ini

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

pyproject.toml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,65 @@
1+
[build-system]
2+
requires = ["poetry-core>=1.0.0"]
3+
build-backend = "poetry.core.masonry.api"
4+
5+
[tool.poetry]
6+
name = "alembic_utils"
7+
version = "0.8.7"
8+
description = "A sqlalchemy/alembic extension for migrating procedures and views"
9+
authors = ["Oliver Rice <[email protected]>"]
10+
license = "MIT"
11+
readme = "README.md"
12+
packages = [{include = "alembic_utils", from = "src"}]
13+
classifiers = [
14+
"Development Status :: 4 - Beta",
15+
"License :: OSI Approved :: MIT License",
16+
"Intended Audience :: Developers",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.9",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
22+
"Programming Language :: Python :: 3.13",
23+
"Programming Language :: SQL",
24+
]
25+
26+
[tool.poetry.urls]
27+
"PyPI" = "https://pypi.org/project/alembic-utils/"
28+
29+
[tool.poetry.dependencies]
30+
python = ">=3.9"
31+
alembic = ">=1.9"
32+
flupy = "*"
33+
parse = ">=1.8.4"
34+
sqlalchemy = ">=1.4"
35+
typing_extensions = "*"
36+
37+
[tool.poetry.group.dev.dependencies]
38+
black = "*"
39+
pylint = "*"
40+
pre-commit = "*"
41+
mypy = "*"
42+
psycopg2-binary = "*"
43+
pytest = "*"
44+
pytest-cov = "*"
45+
mkdocs = "*"
46+
47+
[tool.poetry.group.nvim.dependencies]
48+
neovim = "*"
49+
python-language-server = "*"
50+
51+
[tool.poetry.group.docs.dependencies]
52+
mkdocs = "*"
53+
pygments = "*"
54+
pymdown-extensions = "*"
55+
mkautodoc = "*"
56+
57+
[tool.setuptools.packages.find]
58+
where = ["src"]
59+
60+
[tool.setuptools.package-data]
61+
"*" = ["py.typed"]
62+
163
[tool.black]
264
line-length = 100
365
exclude = '''
@@ -13,3 +75,17 @@ exclude = '''
1375
| dist
1476
)/
1577
'''
78+
79+
[tool.isort]
80+
known_third_party = ["alembic", "flupy", "parse", "pytest", "setuptools", "sqlalchemy"]
81+
82+
[tool.mypy]
83+
follow_imports = "skip"
84+
strict_optional = true
85+
warn_redundant_casts = true
86+
warn_unused_ignores = false
87+
disallow_any_generics = true
88+
check_untyped_defs = true
89+
no_implicit_reexport = true
90+
ignore_missing_imports = true
91+
# disallow_untyped_defs = true

src/alembic_utils/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
__version__ = "0.8.6"

0 commit comments

Comments
 (0)