diff --git a/.copier-answers.yml b/.copier-answers.yml index f529967..0caecca 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,10 +1,11 @@ # Changes here will be overwritten by Copier -_commit: 0.1.4 +_commit: 0.1.11 _src_path: gh:12rambau/pypackage author_email: pierrick.rambaud49@gmail.com author_first_name: Pierrick author_last_name: Rambaud author_orcid: "" +creation_year: "2020" github_repo_name: ipygee github_user: 12rambau project_name: ipygee diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0a979fa..673d5c1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,5 +8,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" } diff --git a/.github/workflows/pypackage_check.yaml b/.github/workflows/pypackage_check.yaml index 85af024..648f1a6 100644 --- a/.github/workflows/pypackage_check.yaml +++ b/.github/workflows/pypackage_check.yaml @@ -46,4 +46,7 @@ jobs: copier update --trust --defaults --vcs-ref ${{ steps.get_latest_release.outputs.latest }} ``` + > **Note** + > You may need to reinstall ``copier`` and ``jinja2-time`` if they are not available in your environment. + After solving the merging issues you can push back the changes to your main branch. diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index af4ca67..6136dfd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 @@ -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/* diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 26f5686..4519ed9 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -1,6 +1,7 @@ name: Unit tests on: + workflow_call: push: branches: - main @@ -67,24 +68,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 diff --git a/.gitignore b/.gitignore index 3d4ee4a..d8b224a 100644 --- a/.gitignore +++ b/.gitignore @@ -136,5 +136,5 @@ dmypy.json # image tmp file *Zone.Identifier -# experimental notebooks for visual debugging -test.ipynb \ No newline at end of file +# debugging notebooks +test.ipynb diff --git a/LICENSE b/LICENSE index eb6ed2c..8c8ad26 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Pierrick Rambaud +Copyright (c) 2020 Pierrick Rambaud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.rst b/README.rst index bdbd6ca..8608d90 100644 --- a/README.rst +++ b/README.rst @@ -46,4 +46,4 @@ widgets to interact with GEE API Credits ------- -This package was created with `Copier `__ and the `@12rambau/pypackage `__ 0.1.4 project template . +This package was created with `Copier `__ and the `@12rambau/pypackage `__ 0.1.11 project template. diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..de09d04 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,2 @@ +# disable the treemap comment and report in PRs +comment: false diff --git a/docs/_template/pypackage-credit.html b/docs/_template/pypackage-credit.html index c8a53c1..bd76288 100644 --- a/docs/_template/pypackage-credit.html +++ b/docs/_template/pypackage-credit.html @@ -1,5 +1,5 @@

From @12rambau/pypackage - 0.1.4 Copier project. + 0.1.11 Copier project.

diff --git a/noxfile.py b/noxfile.py index 6ed4410..c68bd9d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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") diff --git a/pyproject.toml b/pyproject.toml index 9fafee9..15fc83f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ @@ -87,6 +87,9 @@ version_files = [ [tool.pytest.ini_options] testpaths = "tests" +[tool.black] +line-length = 105 # super small margin for items that are 2 characters too long + [tool.ruff] ignore-init-module-imports = true fix = true @@ -117,6 +120,3 @@ warn_redundant_casts = true [tool.licensecheck] using = "PEP631" - -[tool.black] -line-length = 105 # super small margin for items that are 2 characters too long