Skip to content

Commit 0d3e5b2

Browse files
authored
Merge pull request #5 from runemalm/feature/next-version
Release version 1.0.0-alpha.7
2 parents 1c97bb8 + 3dc6699 commit 0d3e5b2

35 files changed

+1015
-535
lines changed

.github/workflows/feature.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ on:
66
- 'feature/*'
77

88
jobs:
9+
pre-commit:
10+
name: Run pre-commit
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.7'
20+
21+
- name: Run pre-commit
22+
uses: pre-commit/action@v3.0.1
23+
924
unittests:
1025
name: Run tests
1126
runs-on: ubuntu-latest
@@ -18,7 +33,7 @@ jobs:
1833
steps:
1934
- name: Checkout code
2035
uses: actions/checkout@v4
21-
36+
2237
- name: Run unittests
2338
uses: ./.github/actions/unittests
2439
with:

.github/workflows/master.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ on:
77
workflow_dispatch:
88

99
jobs:
10+
pre-commit:
11+
name: Run pre-commit
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.7'
22+
23+
- name: Run pre-commit
24+
uses: pre-commit/action@v3.0.1
25+
1026
unittests:
1127
name: Run unittests
1228
runs-on: ubuntu-latest
@@ -19,7 +35,7 @@ jobs:
1935
steps:
2036
- name: Checkout code
2137
uses: actions/checkout@v4
22-
38+
2339
- name: Run unittests
2440
uses: ./.github/actions/unittests
2541
with:
@@ -71,7 +87,7 @@ jobs:
7187
version=$(grep -Eo "version=['\"]([^'\"]+)['\"]" setup.py | awk -F"'" '{print $2}')
7288
echo "Using version: $version"
7389
echo "::set-output name=RELEASE_VERSION::$version"
74-
90+
7591
- name: Publish to PyPI
7692
uses: pypa/gh-action-pypi-publish@release/v1
7793
with:
@@ -84,7 +100,7 @@ jobs:
84100
run: |
85101
git config --global user.name "${{ github.actor }}"
86102
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
87-
103+
88104
- name: Create and push tag
89105
run: |
90106
git tag -a v${{ steps.extract-version.outputs.RELEASE_VERSION }} -m "Release version v${{ steps.extract-version.outputs.RELEASE_VERSION }}"

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v3.4.0 # Use the latest version
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- repo: https://github.com/psf/black-pre-commit-mirror
10+
rev: 22.3.0 # Use the latest version
11+
hooks:
12+
- id: black
13+
args: ["--line-length=88"] # Adjust line length as needed
14+
language_version: python3.7
15+
- repo: https://github.com/pycqa/flake8
16+
rev: 4.0.1 # Use the latest version
17+
hooks:
18+
- id: flake8
19+
args: ['--max-line-length=88']

Makefile

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,37 @@ sphinx-rebuild: ## re-build the sphinx docs
7373
sphinx-autobuild: ## activate autobuild of docs
7474
pipenv run sphinx-autobuild docs docs/_build/html --watch $(SRC)
7575

76+
################################################################################
77+
# FORMAT & LINT
78+
################################################################################
79+
80+
.PHONY: black
81+
black: ## run black auto-formatting
82+
pipenv run black $(SRC) $(TESTS) --line-length=88
83+
84+
.PHONY: black-check
85+
black-check: ## check code don't violate black formatting rules
86+
pipenv run black --check $(SRC) --line-length=88
87+
88+
.PHONY: flake
89+
flake: ## lint code with flake
90+
pipenv run flake8 $(SRC)
91+
92+
.PHONY: pre-commit-install
93+
pre-commit-install: ## install the pre-commit git hook
94+
pipenv run pre-commit install
95+
96+
.PHONY: pre-commit-run
97+
pre-commit-run: ## run the pre-commit hooks
98+
pipenv run pre-commit run --all-files
99+
76100
################################################################################
77101
# PIPENV
78102
################################################################################
79103

80104
.PHONY: pipenv-install
81105
pipenv-install: ## setup the virtual environment
82-
pipenv --python 3.7 install --dev
106+
pipenv install --dev
83107

84108
.PHONY: pipenv-packages-install
85109
pipenv-packages-install: ## install a package (uses PACKAGE)

Pipfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ sphinxcontrib-napoleon = "0.7"
1414
wheel = "0.41.2"
1515
pytest-xdist = "*"
1616
bump2version = "*"
17+
black = "*"
18+
flake8 = "*"
19+
importlib-metadata = "==4.13.0"
20+
pre-commit = "*"
1721

1822
[requires]
19-
python_version = ">=3.7"
23+
python_version = "3.7.17"

0 commit comments

Comments
 (0)