-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from lwasser/add-coverage
Fix: add test coverage
- Loading branch information
Showing
6 changed files
with
65 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,10 @@ jobs: | |
- name: Run tests | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: hatch run test:run-tests | ||
run: hatch run test:run-report | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true | ||
files: ./coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ all_contribs_dict.pickle | |
.idea/ | ||
.token | ||
__pycache__ | ||
.coverage | ||
coverage.xml | ||
|
||
|
||
# Distribution / packaging | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,20 +8,20 @@ dynamic = ["version"] | |
description = "Tools that update the pyOpenSci contributor and review metadata that is posted on our website" | ||
authors = [{ name = "Leah Wasser", email = "[email protected]" }] | ||
maintainers = [ | ||
{ name = "pyOpenSci", email = "[email protected]" }, # Optional | ||
{ name = "pyOpenSci", email = "[email protected]" }, # Optional | ||
] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Topic :: Software Development :: Build Tools", | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Topic :: Software Development :: Build Tools", | ||
|
||
# Pick your license - we suggest MIT, BSD3 or Apache if you are corporate | ||
"License :: OSI Approved :: MIT License", | ||
# Specify the Python versions ensuring that you indicate you support Python 3. | ||
# this is only for pypi and other metadata associated with your package - for your users to see | ||
"Programming Language :: Python :: 3 :: Only", # BE sure to specify that you use python 3.x | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
# Pick your license - we suggest MIT, BSD3 or Apache if you are corporate | ||
"License :: OSI Approved :: MIT License", | ||
# Specify the Python versions ensuring that you indicate you support Python 3. | ||
# this is only for pypi and other metadata associated with your package - for your users to see | ||
"Programming Language :: Python :: 3 :: Only", # BE sure to specify that you use python 3.x | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
] | ||
dependencies = [ | ||
"pydantic>=2.0", | ||
|
@@ -56,6 +56,11 @@ update-contributors = "pyosmeta.cli.update_contributors:main" | |
update-reviews = "pyosmeta.cli.process_reviews:main" | ||
update-review-teams = "pyosmeta.cli.update_review_teams:main" | ||
|
||
[tool.coverage.run] | ||
branch = true | ||
include = ["src/pyosmeta/*"] | ||
# Don't run coverage on tests directory or version file created by scm | ||
omit = ["tests/*", "src/pyosmeta/_version.py"] | ||
|
||
### Hatch config ### | ||
|
||
|
@@ -64,15 +69,12 @@ version.source = "vcs" | |
build.hooks.vcs.version-file = "src/pyosmeta/_version.py" | ||
|
||
[tool.hatch.envs.test] | ||
dependencies = [ | ||
"pytest", | ||
"pytest-cov", | ||
] | ||
dependencies = ["pytest", "pytest-cov", "coverage[toml]"] | ||
|
||
[tool.hatch.envs.test.scripts] | ||
#run-coverage = "pytest --cov-config=pyproject.toml --cov=pkg --cov=tests" | ||
#run = "run-coverage --no-cov" | ||
run-tests = "pytest" | ||
run-coverage = "pytest --cov-config=pyproject.toml --cov=pyosmeta --cov=tests/*" | ||
run-no-cov = "run-coverage --no-cov" | ||
run-report = "run-coverage --cov-report=xml:coverage.xml" | ||
|
||
|
||
### Tool configuration ### | ||
|