Skip to content

Commit

Permalink
Merge pull request #2 from python-project-templates/copier-update-202…
Browse files Browse the repository at this point in the history
…4-10-08T21-00-18

Update from copier (2024-10-08T21-00-18)
  • Loading branch information
timkpaine authored Oct 8, 2024
2 parents 7633df1 + 4ccc37a commit 63db720
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 42e01c1
_commit: b569c29
_src_path: https://github.com/python-project-templates/base.git
add_extension: js
email: [email protected]
Expand Down
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,12 @@ updates:
labels:
- "lang: python"
- "part: dependencies"

- package-ecosystem: "npm"
directory: "/js"
schedule:
interval: "monthly"
labels:
- "lang: javascript"
- "part: dependencies"

25 changes: 19 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Build Status

on:
Expand Down Expand Up @@ -44,6 +43,11 @@ jobs:
cache: 'pip'
cache-dependency-path: 'pyproject.toml'

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
Expand All @@ -55,18 +59,18 @@ jobs:

- name: Lint
run: make lint
if: ${{ matrix.os == 'ubuntu-latest' }}
if: matrix.os == 'ubuntu-latest'

- name: Checks
run: make checks
if: ${{ matrix.os == 'ubuntu-latest' }}
if: matrix.os == 'ubuntu-latest'

- name: Build
run: make build

- name: Test
run: make coverage
if: ${{ matrix.os == 'ubuntu-latest' }}
if: matrix.os == 'ubuntu-latest'

- name: Upload test results
uses: actions/upload-artifact@v4
Expand All @@ -81,12 +85,21 @@ jobs:
with:
files: |
**/junit.xml
if: ${{ matrix.os == 'ubuntu-latest' }}
if: matrix.os == 'ubuntu-latest'

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Make dist
run: make dist
if: ${{ matrix.os == 'ubuntu-latest' }}
if: matrix.os == 'ubuntu-latest'

- uses: actions/upload-artifact@v4
with:
name: dist-${{matrix.os}}
path: dist
if: matrix.os == 'ubuntu-latest'


12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ annotate: ## run python type annotation checks with mypy
#########
.PHONY: test-py tests-py coverage-py
test-py: ## run python tests
python -m pytest -v js_template/tests --junitxml=junit.xml
python -m pytest -v js_template/tests

# alias
tests-py: test-py

coverage-py: ## run python tests and collect test coverage
python -m pytest -v js_template/tests --junitxml=junit.xml --cov=js_template --cov-branch --cov-fail-under=50 --cov-report term-missing --cov-report xml
python -m pytest -v js_template/tests --cov=js_template --cov-report term-missing --cov-report xml

.PHONY: test-js tests-js coverage-js
test-js: ## run js tests
Expand Down Expand Up @@ -117,18 +117,18 @@ major: ## bump a major version
########
# DIST #
########
.PHONY: dist dist-build dist-sdist dist-local-wheel publish
.PHONY: dist dist-py dist-js dist-check publish

dist-build-py: # build python dists
dist-py: # build python dists
python -m build -w -s

dist-build-js: # build js dists
dist-js: # build js dists
cd js; pnpm pack

dist-check: ## run python dist checker with twine
python -m twine check dist/*

dist: clean build dist-build-js dist-build-py dist-check ## build all dists
dist: clean build dist-js dist-py dist-check ## build all dists

publish: dist # publish python assets

Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ ignore = [
"js_template/**/*",
]

[tool.coverage.run]
branch = true
omit = [
"js_template/tests/integration/",
]
[tool.coverage.report]
exclude_also = [
"raise NotImplementedError",
"if __name__ == .__main__.:",
"@(abc\\.)?abstractmethod",
]
ignore_errors = true
fail_under = 50

[tool.hatch.build]
artifacts = [
"js_template/extension",
Expand Down Expand Up @@ -132,6 +146,7 @@ build_cmd = "build"
npm = "pnpm"

[tool.pytest.ini_options]
addopts = ["-vvv", "--junitxml=junit.xml"]
asyncio_mode = "strict"
testpaths = "js_template/tests"

Expand Down

0 comments on commit 63db720

Please sign in to comment.