-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acf1b21
commit c654cec
Showing
13 changed files
with
188 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash -e {0} # -e to fail on error | ||
|
||
jobs: | ||
run_tester: | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { name: "3.9", os: ubuntu-latest, python: "3.9" } | ||
- { name: "3.10", os: ubuntu-latest, python: "3.10" } | ||
- { name: "3.11", os: ubuntu-latest, python: "3.11" } | ||
- { name: "3.12", os: ubuntu-latest, python: "3.12" } | ||
|
||
steps: | ||
- name: Clone repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
filter: blob:none | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.config.python }} | ||
cache: pip | ||
|
||
- name: Install Python tools | ||
run: | | ||
python -m pip install --upgrade pip wheel | ||
- name: Install Python package and dependencies | ||
run: pip install .[test] coverage coveralls | ||
|
||
- name: Run tests | ||
run: coverage run --source=get_version -m pytest --verbose --color=yes | ||
|
||
- name: Coveralls | ||
uses: coverallsapp/github-action@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# Caches | ||
__pycache__/ | ||
/.pytest_cache/ | ||
/.mypy_cache/ | ||
/.*cache/ | ||
/.coverage | ||
|
||
# Packaging | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,30 @@ | ||
# To install the git pre-commit hooks run: | ||
# pre-commit install --install-hooks | ||
# To update the versions: | ||
# pre-commit autoupdate | ||
# Note the order is intentional to avoid multiple passes of the hooks | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 23.7.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.0.292 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix, --show-fixes] | ||
- repo: https://github.com/psf/black | ||
rev: 23.9.1 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v3.0.3 | ||
hooks: | ||
- id: prettier | ||
exclude: front/package-lock\.json | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: debug-statements | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.5.1 | ||
hooks: | ||
- id: mypy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
overrides: | ||
# JSON with comments and trailing commas | ||
- files: .vscode/*.json | ||
options: | ||
parser: json5 | ||
quoteProps: preserve | ||
singleQuote: false |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"[python][json][jsonc][yaml]": { | ||
"editor.formatOnSave": true, | ||
}, | ||
"[json][jsonc][yaml]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
}, | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": true, | ||
"source.organizeImports": true, | ||
}, | ||
}, | ||
"python.testing.pytestArgs": [], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,22 @@ | ||
[build-system] | ||
requires = ['flit-core>=2,<4', 'dunamai'] | ||
build-backend = 'flit_core.buildapi' | ||
|
||
[tool.flit.metadata] | ||
module = 'get_version' | ||
author = 'Philipp Angerer' | ||
author-email = '[email protected]' | ||
home-page = 'https://github.com/flying-sheep/get_version' | ||
[project] | ||
name = 'get_version' | ||
authors = [{ name = 'Philipp Angerer', email = '[email protected]' }] | ||
urls.Homepage = 'https://github.com/flying-sheep/get_version' | ||
classifiers = [ | ||
'Intended Audience :: Developers', | ||
'Programming Language :: Python :: 3', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', | ||
] | ||
requires-python = '>=3.7' | ||
requires = [ | ||
'dunamai', # Version parsing | ||
'importlib_metadata; python_version < "3.8"', | ||
'typing_extensions; python_version < "3.8"', | ||
readme = 'README.rst' | ||
license = { file = 'LICENSE' } # 'GPL-3.0-or-later' | ||
requires-python = '>=3.9' | ||
dependencies = [ | ||
'dunamai>=1.19.0', # Version parsing | ||
] | ||
description-file = 'README.rst' | ||
dynamic = ['version', 'description'] | ||
|
||
[tool.flit.metadata.requires-extra] | ||
[project.optional-dependencies] | ||
test = [ | ||
'pytest>=6.2.5', | ||
'pytest-black', | ||
|
@@ -32,8 +27,12 @@ test = [ | |
[tool.black] | ||
include = '\.pyi?$' | ||
|
||
[tool.ruff] | ||
select = ['E', 'F', 'W', 'I', 'UP', 'TCH'] | ||
|
||
[tool.pytest.ini_options] | ||
addopts = '-p get_version.testing' | ||
|
||
[tool.mypy] | ||
mypy_path = './type-stubs' | ||
[build-system] | ||
requires = ['flit-core>=2,<4', 'dunamai'] | ||
build-backend = 'flit_core.buildapi' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.