Skip to content

Commit 5cc9c01

Browse files
authored
Merge pull request #53 from febus982/bootstrap-implementation-update
Bootstrap implementation update
2 parents d89843e + d7e0f57 commit 5cc9c01

28 files changed

+224
-542
lines changed

.bandit.yml

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

.codeclimate.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
version: "2"
22
plugins:
3-
bandit:
4-
enabled: true
53
sonar-python:
64
enabled: true

.github/workflows/python-lint.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
python -m pip install poetry
28-
poetry config virtualenvs.create false
29-
poetry install --no-root --with dev
27+
python -m pip install poetry tox
28+
make poetry-export
3029
- name: Lint with ruff
3130
run: make lint

.github/workflows/python-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,3 @@ jobs:
3333
- name: Test with pytest
3434
run: |
3535
make ci-test
36-
- name: Check typing
37-
run: |
38-
make typing
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
33

4-
name: Bandit checks
4+
name: Python typing
55

66
on:
77
push:
@@ -12,21 +12,19 @@ on:
1212
workflow_dispatch:
1313

1414
jobs:
15-
bandit:
15+
typing:
1616
runs-on: ubuntu-latest
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
21-
- name: Security check - Bandit
22-
uses: ioggstream/[email protected]
23-
with:
24-
project_path: .
25-
config_file: .bandit.yml
26-
27-
# This is optional
28-
- name: Security check report artifacts
29-
uses: actions/upload-artifact@v4
20+
- name: Set up Python 3.12
21+
uses: actions/setup-python@v5
3022
with:
31-
name: Security report
32-
path: output/security_report.txt
23+
python-version: "3.12"
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
python -m pip install poetry tox
28+
make poetry-export
29+
- name: Check typing
30+
run: make typing

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ jobs:
7272
# REMOVE CUSTOM REPOSITORY TO #
7373
# PUBLISH ON OFFICIAL PYPI #
7474
################################
75-
with:
76-
repository-url: https://test.pypi.org/legacy/
75+
# with:
76+
# repository-url: https://test.pypi.org/legacy/
7777

7878
site:
7979
needs: build

.idea/sqlalchemy-bind-manager.iml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,49 @@
1-
.PHONY: docs
1+
.PHONY: dev-dependencies update-dependencies test docs fix check typing lint format ci-test ci-coverage poetry-export
2+
3+
#########################
4+
###### dev commands #####
5+
#########################
6+
dev-dependencies:
7+
poetry install --with dev --no-root
8+
9+
update-dependencies:
10+
poetry update --with dev
211

312
test:
413
poetry run pytest -n auto --cov
514

6-
ci-test:
7-
poetry run pytest
8-
9-
ci-coverage:
10-
poetry run pytest --cov --cov-report lcov
15+
docs:
16+
poetry run mkdocs serve
1117

12-
typing:
13-
poetry run mypy
18+
fix:
19+
poetry run ruff . --fix
20+
poetry run ruff format .
1421

15-
format:
16-
poetry run black --check .
22+
check: poetry-export
23+
tox
1724

18-
lint:
19-
poetry run ruff .
25+
typing: poetry-export
26+
tox -e typing
2027

21-
bandit:
22-
poetry run bandit -c .bandit.yml -r .
28+
lint: poetry-export
29+
tox -e lint
2330

24-
format-fix:
25-
poetry run black .
31+
format: poetry-export
32+
tox -e format
2633

27-
lint-fix:
28-
poetry run ruff . --fix
2934

30-
dev-dependencies:
31-
poetry install --with dev --no-root
35+
#########################
36+
#### Helper commands ####
37+
#########################
38+
poetry-export:
39+
poetry export -f requirements.txt --output /tmp/requirements.txt --with dev
3240

33-
update-dependencies:
34-
poetry update --with dev
3541

36-
fix: format-fix lint-fix
37-
check: typing format lint test bandit
42+
#########################
43+
###### CI commands ######
44+
#########################
45+
ci-test:
46+
poetry run pytest
3847

39-
docs:
40-
poetry run mkdocs serve
48+
ci-coverage:
49+
poetry run pytest --cov --cov-report lcov

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
[![stability-beta](https://img.shields.io/badge/stability-beta-33bbff.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#beta)
55

66
[![Python tests](https://github.com/febus982/sqlalchemy-bind-manager/actions/workflows/python-tests.yml/badge.svg?branch=main)](https://github.com/febus982/sqlalchemy-bind-manager/actions/workflows/python-tests.yml)
7-
[![Bandit checks](https://github.com/febus982/sqlalchemy-bind-manager/actions/workflows/python-bandit.yml/badge.svg?branch=main)](https://github.com/febus982/sqlalchemy-bind-manager/actions/workflows/python-bandit.yml)
87
[![Maintainability](https://api.codeclimate.com/v1/badges/0140f7f4e559ae806887/maintainability)](https://codeclimate.com/github/febus982/sqlalchemy-bind-manager/maintainability)
98
[![Test Coverage](https://api.codeclimate.com/v1/badges/0140f7f4e559ae806887/test_coverage)](https://codeclimate.com/github/febus982/sqlalchemy-bind-manager/test_coverage)
109

pyproject.toml

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,26 @@ optional = true
4747

4848
[tool.poetry.group.dev.dependencies]
4949
aiosqlite = ">=0.18.0"
50-
bandit = ">=1.7.7"
5150
coverage = ">=6.5.0"
52-
black = ">=22.10.0"
5351
mike = ">=2.0.0"
5452
mkdocs = ">=1.4.3"
5553
mkdocstrings = { version = ">=0.24.0", extras = ["python"] }
5654
mkdocs-gen-files = ">=0.5.0"
5755
mkdocs-material = ">=9.1.16"
5856
mypy = ">=0.990"
5957
pymdown-extensions = ">=10.0.1"
60-
pytest = ">=7.2.0"
58+
pytest = "^8.0.0"
6159
pytest-asyncio = ">=0.20.3"
6260
pytest-cov = ">=4.0.0"
6361
pytest-factoryboy = ">=2.5.0"
6462
pytest-xdist = ">=3.0.2"
6563
ruff = ">=0.0.263"
64+
tox = "^4.14.1"
6665
mkdocs-awesome-pages-plugin = "^2.9.2"
6766

68-
[tool.pytest.ini_options]
69-
asyncio_mode = "auto"
70-
minversion = "6.0"
71-
addopts = "-n auto --cov-report=term-missing"
72-
testpaths = [
73-
"tests",
74-
]
75-
67+
############################
68+
### Tools configuration ###
69+
############################
7670
[tool.coverage.run]
7771
branch = true
7872
source = ["sqlalchemy_bind_manager"]
@@ -89,20 +83,51 @@ exclude_also = [
8983

9084
[tool.mypy]
9185
files = "sqlalchemy_bind_manager"
86+
python_version = "3.8"
9287
plugins = "pydantic.mypy"
9388

89+
[tool.pytest.ini_options]
90+
asyncio_mode = "auto"
91+
minversion = "6.0"
92+
addopts = "-n auto --cov-report=term-missing"
93+
testpaths = [
94+
"tests",
95+
]
96+
9497
[tool.ruff]
95-
select = ["E", "F", "I"]
96-
extend-exclude = ["docs"]
98+
extend-exclude = ["docs", ".tox"]
99+
target-version = "py38"
97100

98-
[tool.ruff.per-file-ignores]
101+
[tool.ruff.lint]
102+
select = [
103+
"E", # pycodestyle
104+
"W", # pycodestyle
105+
"F", # pyflakes
106+
"I", # isort
107+
"N", # pep8-naming
108+
"S", # flake8-bandit
109+
"RUF", # ruff-specific-rules
110+
]
111+
# Ignoring rules problematic with formatter
112+
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
113+
ignore = [
114+
"W191",
115+
"E111",
116+
"E114",
117+
"E117",
118+
"D206",
119+
"D300",
120+
"Q000",
121+
"Q001",
122+
"Q002",
123+
"Q003",
124+
"COM812",
125+
"COM819",
126+
"ISC001",
127+
"ISC002",
128+
]
129+
130+
[tool.ruff.lint.per-file-ignores]
99131
"__init__.py" = ["F401"]
100132
"repository.py" = ["F401"]
101-
102-
[tool.black]
103-
target-version = ["py38", "py39", "py310", "py311", "py312"]
104-
extend-exclude = '''
105-
(
106-
/docs
107-
)
108-
'''
133+
"tests/**/*.py" = ["S101"] # Allow assert usage on tests

0 commit comments

Comments
 (0)