Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.1.4 #2

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
run: tox

- name: Upload coverage to Codecov
# We only generate the coverage report in Python 3.9
if: "matrix.python-version == '3.9'"
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
18 changes: 17 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,28 @@ repos:
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending

- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: ["--check"]

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
args: ["--profile", "black"]
args: ["--check", "--profile", "black"]

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies: [mccabe]
args: ["--max-line-length", "88", "--max-complexity", "10"]

- repo: https://github.com/PyCQA/pylint/
rev: v2.14.5
hooks:
- id: pylint
exclude: tests/ # Prevent files in tests/ to be passed in to pylint.
40 changes: 40 additions & 0 deletions changelog.d/20220728_093451_5621605+RodrigoGiraoSerrao.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!--
A new scriv changelog fragment.

Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Removed

- A bullet item for the Removed category.

-->
<!--
### Added

- A bullet item for the Added category.

-->
### Changed

- Change code layout to use a top-level directory `src`.

<!--
### Deprecated

- A bullet item for the Deprecated category.

-->
<!--
### Fixed

- A bullet item for the Fixed category.

-->
<!--
### Security

- A bullet item for the Security category.

-->
40 changes: 40 additions & 0 deletions changelog.d/20220728_094214_5621605+RodrigoGiraoSerrao.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!--
A new scriv changelog fragment.

Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Removed

- A bullet item for the Removed category.

-->
<!--
### Added

- A bullet item for the Added category.

-->
### Changed

- tox now runs linting through pre-commit.

<!--
### Deprecated

- A bullet item for the Deprecated category.

-->
<!--
### Fixed

- A bullet item for the Fixed category.

-->
<!--
### Security

- A bullet item for the Security category.

-->
39 changes: 39 additions & 0 deletions changelog.d/20220728_095740_5621605+RodrigoGiraoSerrao.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!--
A new scriv changelog fragment.

Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Removed

- A bullet item for the Removed category.

-->
<!--
### Added

- A bullet item for the Added category.

-->
### Changed

- Only produce coverage report for Python 3.9.
<!--
### Deprecated

- A bullet item for the Deprecated category.

-->
<!--
### Fixed

- A bullet item for the Fixed category.

-->
<!--
### Security

- A bullet item for the Security category.

-->
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ scriv = {extras = ["toml"], version = "^0.15.2"}

[tool.scriv]
format = "md"
version = "literal: extendedjson/__init__.py: __version__"
version = "literal: src/extendedjson/__init__.py: __version__"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
File renamed without changes.
38 changes: 21 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
[tox]
isolated_build = True
envlist = py38,py39,py310
envlist =
py38
py39
py310
linting
coverage

[testenv]
deps =
black
coverage
flake8
isort
mccabe
pylint
pytest
changedir = {envtmpdir} # Move elsewhere to ensure pytest doesn't run from source root.
commands = pytest {toxinidir}

[testenv:linting]
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure

[testenv:coverage]
deps =
pytest
coverage
commands =
black --check extendedjson
isort --check extendedjson
flake8 extendedjson --max-line-length 88 --max-complexity 10
pylint extendedjson
pytest .
coverage run --source=extendedjson --branch -m pytest .
coverage run --source=extendedjson --branch -m pytest {toxinidir}
coverage report -m --fail-under 100
coverage xml

coverage xml -o {toxinidir}/coverage.xml

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.9: py39, coverage
3.10: py310, linting