Skip to content

Commit

Permalink
chore: update template version (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
12rambau authored Mar 4, 2024
2 parents 2a37095 + 4dea9db commit 48b10b7
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 28 deletions.
3 changes: 2 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Changes here will be overwritten by Copier
_commit: 0.1.5
_commit: 0.1.11
_src_path: gh:12rambau/pypackage
author_email: alice.barthe@cern.ch
author_first_name: Alice
author_last_name: Barthe
author_orcid: 0000-0002-1766-188X
creation_year: "2024"
github_repo_name: qutree
github_user: alice4space
project_name: qutree
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"ghcr.io/devcontainers-contrib/features/nox:2": {},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {}
},
"postCreateCommand": "pre-commit install"
"postCreateCommand": "python -m pip install commitizen && pre-commit install"
}
9 changes: 5 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ on:
types: [created]

jobs:
tests:
uses: ./.github/workflows/unit.yaml

deploy:
needs: [tests]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -21,6 +24,4 @@ jobs:
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine upload dist/*
run: python -m build && twine upload dist/*
25 changes: 15 additions & 10 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Unit tests

on:
workflow_call:
push:
branches:
- main
Expand Down Expand Up @@ -63,24 +64,28 @@ jobs:
- name: Install nox
run: pip install nox
- name: test with pytest
run: nox -s test
run: nox -s ci-test
- name: assess dead fixtures
if: ${{ matrix.python-version == '3.10' }}
shell: bash
run: nox -s dead-fixtures
- uses: actions/upload-artifact@v4
if: ${{ matrix.python-version == '3.10' }}
with:
name: coverage
path: coverage.xml

coverage:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/download-artifact@v4
with:
python-version: "3.10"
- name: Install deps
run: pip install nox
- name: test with pytest
run: nox -s test
- name: assess dead fixtures
run: nox -s dead-fixtures
name: coverage
path: coverage.xml
- name: codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,7 @@ dmypy.json
.vscode/

# image tmp file
*Zone.Identifier
*Zone.Identifier

# debugging notebooks
test.ipynb
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ Contribute

If you want to contribute you can fork the project in your own repository and then use it. If you consider working with us, please follow the `contributing guidelines <https://pyqutree.readthedocs.io/en/latest/contribute.html>`__.

Meet our `contributor <https://pyqutree.readthedocs.io/en/latest/authors.html>`__.
This package was created with `Copier <https://copier.readthedocs.io/en/latest/>`__ and the `@12rambau/pypackage <https://github.com/12rambau/pypackage>`__ 0.1.11 project template.
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# disable the treemap comment and report in PRs
comment: false
5 changes: 5 additions & 0 deletions docs/_template/pypackage-credit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<p class="pypackage-credit">
From
<a href="https://github.com/12rambau/pypackage">@12rambau/pypackage</a>
0.1.11 Copier project.
</p>
8 changes: 3 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
sys.path.insert(0, os.path.abspath("../.."))
sys.path.insert(0, os.path.abspath("../../examples"))

from qutree import __author__, __version__ # noqa

# -- Project information -------------------------------------------------------
project = "qutree"
copyright = f"2022-{datetime.now().year}, {__author__}"
author = __author__
release = __version__
author = "Alice Barthe"
copyright = f"2024-{datetime.now().year}, {author}"
release = "0.1.1"

# -- General configuration -----------------------------------------------------
extensions = [
Expand Down
12 changes: 10 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ def lint(session):

@nox.session(reuse_venv=True)
def test(session):
"""Run all the test using the environment variable of the running machine."""
"""Run the selected tests and report coverage in html."""
session.install(".[test]")
test_files = session.posargs or ["tests"]
session.run("pytest", "--color=yes", "--cov", "--cov-report=xml", *test_files)
session.run("pytest", "--color=yes", "--cov", "--cov-report=html", *test_files)


@nox.session(reuse_venv=True, name="ci-test")
def ci_test(session):
"""Run all the test and report coverage in xml."""
session.install(".[test]")
session.posargs[0] if session.posargs else "default"
session.run("pytest", "--color=yes", "--cov", "--cov-report=xml")


@nox.session(reuse_venv=True, name="dead-fixtures")
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
requires-python = ">=3.8"
dependencies = [
Expand Down Expand Up @@ -82,11 +83,15 @@ version = "0.1.1"
version_files = [
"pyproject.toml:version",
"qutree/__init__.py:__version__",
"docs/conf.py:version",
]

[tool.pytest.ini_options]
testpaths = "tests"

[tool.black]
line-length = 100

[tool.ruff]
ignore-init-module-imports = true
fix = true
Expand Down
4 changes: 1 addition & 3 deletions qutree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ def phimp_phi01(phi0, phi1):
return phil, phig


def thephi_to_xyz(
the: np.ndarray, phi: np.ndarray
) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
def thephi_to_xyz(the: np.ndarray, phi: np.ndarray) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
r"""Spherical to cartesian.
Args:
Expand Down

0 comments on commit 48b10b7

Please sign in to comment.