Skip to content

Commit

Permalink
Fix CI issues (#46)
Browse files Browse the repository at this point in the history
* Fixed issues with codecov reporting, copier answer validation. Updated github action versions.

* Keeping the raw/endraw tags so that copier does not try to replace {{ matrix.python-version }}.
  • Loading branch information
drewoldag committed Feb 10, 2023
1 parent 370f3b7 commit bd1a552
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Python dependencies
Expand Down
8 changes: 8 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ project_name:
type: str
help: What is the name of your project?
default: example_project
validator: >-
{% if not (project_name | regex_search('^[a-zA-Z][a-zA-Z0-9\_]+$')) %}
project_name must start with a letter, followed one or more letters, digits or underscores all lowercase.
{% endif %}
module_name:
type: str
help: What is your python module name? If left blank, will default to project_name.
default: "{{project_name}}"
validator: >-
{% if not (module_name | regex_search('^[a-zA-Z][a-zA-Z0-9\_]+$')) %}
module_name must start with a letter, followed one or more letters, digits or underscores all lowercase.
{% endif %}
author_name:
type: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
python-version: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python {% raw %}${{ matrix.python-version }}{% endraw %}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: {% raw %}${{ matrix.python-version }}{% endraw %}
- name: Install dependencies
Expand All @@ -32,7 +32,9 @@ jobs:
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run unit tests with pytest
run: |
python -m pytest --cov=. --cov-report=xml
python -m pytest tests --cov={{module_name}} --cov-report=xml
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v3
- name: Analyze code with pylint
run: |
pylint -rn -sn --recursive=y ./src
2 changes: 1 addition & 1 deletion python-project-template/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: pytest-check
name: pytest-check
description: Run unit tests with pytest.
entry: pytest --cov=. --cov-report=html
entry: pytest --cov=./src --cov-report=html
language: system
pass_filenames: false
always_run: true
Expand Down
1 change: 1 addition & 0 deletions python-project-template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ build-backend = "setuptools.build_meta"
disable = """
missing-module-docstring,
"""
ignore-patterns = "^_.*" # Ignore files that start with an underscore, i.e. _version.py

0 comments on commit bd1a552

Please sign in to comment.