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

chore: updat ecopier template #30

Merged
merged 1 commit into from
Mar 9, 2024
Merged
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
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.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
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 3 additions & 0 deletions .github/workflows/pypackage_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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 @@ -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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,5 @@ dmypy.json
# image tmp file
*Zone.Identifier

# experimental notebooks for visual debugging
test.ipynb
# debugging notebooks
test.ipynb
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ widgets to interact with GEE API
Credits
-------

This package was created with `Copier <https://copier.readthedocs.io/en/latest/>`__ and the `@12rambau/pypackage <https://github.com/12rambau/pypackage>`__ 0.1.4 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.4 Copier project.
0.1.11 Copier project.
</p>
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
8 changes: 4 additions & 4 deletions 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 @@ -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
Expand Down Expand Up @@ -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
Loading