Skip to content

Commit

Permalink
chore: update template (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
12rambau authored Feb 5, 2024
2 parents ee7174e + 9fad803 commit d251437
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 24 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: [email protected]
author_first_name: Pierrick
author_last_name: Rambaud
author_orcid: 0000-0000-0000-0000
creation_year: "2023"
github_repo_name: pytest-gee
github_user: gee-community
project_name: pytest-gee
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 @@ -19,6 +22,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/*
24 changes: 14 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 @@ -66,22 +67,25 @@ 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:
Expand Down
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 @@ -50,4 +50,4 @@ The Python plugin for your GEE based packages.
Credits
-------

This package was created with `Copier <https://copier.readthedocs.io/en/latest/>`__ and the `@12rambau/pypackage <https://github.com/12rambau/pypackage>`__ 0.1.5 project template .
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
2 changes: 1 addition & 1 deletion docs/_template/pypackage-credit.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p class="pypackage-credit">
From
<a href="https://github.com/12rambau/pypackage">@12rambau/pypackage</a>
0.1.5 Copier project.
0.1.11 Copier project.
</p>
10 changes: 9 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,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("coverage", "run", "-m", "pytest", "--color=yes", *test_files)
session.run("coverage", "html")


@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.run("coverage", "run", "-m", "pytest", "--color=yes")
session.run("coverage", "xml")


Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.7",
"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 @@ -84,6 +84,9 @@ version_files = [
[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 pytest_gee/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ def export_asset(
return PurePosixPath(asset_id)


def init_tree(
structure: dict, prefix: str, root: Union[str, PurePosixPath]
) -> PurePosixPath:
def init_tree(structure: dict, prefix: str, root: Union[str, PurePosixPath]) -> PurePosixPath:
"""Create an EarthEngine folder tree from a dictionary.
The input ditionary should described the structure of the folder you want to create.
Expand Down

0 comments on commit d251437

Please sign in to comment.