Skip to content

Commit c6679e6

Browse files
committed
Package Template
1 parent 49387fa commit c6679e6

18 files changed

+303
-0
lines changed

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'github-actions'
4+
directory: '/'
5+
schedule:
6+
# Check for updates once a week
7+
interval: 'weekly'

.github/workflows/ci.yaml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CI
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch: # allows you to trigger manually
6+
7+
jobs:
8+
pre-job:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
12+
steps:
13+
- id: skip_check
14+
uses: fkirc/skip-duplicate-actions@master
15+
with:
16+
concurrent_skipping: 'same_content'
17+
skip_after_successful_duplicate: 'false'
18+
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
19+
paths_ignore: '["**/docs/**"]'
20+
21+
build:
22+
needs: pre-job
23+
if: ${{ needs.pre-job.outputs.should_skip != 'true' }}
24+
name: python-${{ matrix.python-version }}
25+
runs-on: ubuntu-latest
26+
defaults:
27+
run:
28+
shell: bash -l {0}
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
python-version: ['3.7', '3.8', '3.9']
33+
steps:
34+
- name: Cancel Previous Runs
35+
uses: styfle/[email protected]
36+
with:
37+
access_token: ${{ github.token }}
38+
- uses: actions/checkout@v2
39+
- uses: conda-incubator/setup-miniconda@v2
40+
with:
41+
channels: conda-forge
42+
mamba-version: '*'
43+
activate-environment: pythia-datasets
44+
auto-update-conda: false
45+
python-version: ${{ matrix.python-version }}
46+
environment-file: ci/environment.yml
47+
48+
- name: Set up conda environment
49+
run: |
50+
python -m pip install -e .
51+
conda list
52+
53+
- name: Run Tests
54+
run: |
55+
python -m pytest --cov=./ --cov-report=xml --verbose
56+
57+
- name: Upload code coverage to Codecov
58+
uses: codecov/[email protected]
59+
with:
60+
file: ./coverage.xml
61+
flags: unittests
62+
env_vars: OS,PYTHON
63+
name: codecov-umbrella
64+
fail_ci_if_error: false

.github/workflows/linting.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: linting
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
pre-job:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
12+
steps:
13+
- id: skip_check
14+
uses: fkirc/skip-duplicate-actions@master
15+
with:
16+
concurrent_skipping: 'same_content'
17+
skip_after_successful_duplicate: 'false'
18+
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
19+
20+
linting:
21+
needs: pre-job
22+
runs-on: ubuntu-latest
23+
if: ${{ needs.pre-job.outputs.should_skip != 'true' }}
24+
steps:
25+
- name: Cancel Previous Runs
26+
uses: styfle/[email protected]
27+
with:
28+
access_token: ${{ github.token }}
29+
- uses: actions/checkout@v2
30+
- uses: actions/setup-python@v2
31+
- uses: pre-commit/[email protected]

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,4 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
.vscode/

.pre-commit-config.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v3.4.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-docstring-first
8+
- id: check-json
9+
- id: check-yaml
10+
- id: double-quote-string-fixer
11+
12+
- repo: https://github.com/ambv/black
13+
rev: 21.4b2
14+
hooks:
15+
- id: black
16+
17+
- repo: https://github.com/keewis/blackdoc
18+
rev: v0.3.3
19+
hooks:
20+
- id: blackdoc
21+
22+
- repo: https://gitlab.com/pycqa/flake8
23+
rev: 3.9.1
24+
hooks:
25+
- id: flake8
26+
27+
- repo: https://github.com/asottile/seed-isort-config
28+
rev: v2.2.0
29+
hooks:
30+
- id: seed-isort-config
31+
- repo: https://github.com/pre-commit/mirrors-isort
32+
rev: v5.8.0
33+
hooks:
34+
- id: isort
35+
36+
- repo: https://github.com/pre-commit/mirrors-prettier
37+
rev: v2.2.1
38+
hooks:
39+
- id: prettier

.prettierrc.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tabWidth = 2
2+
semi = false
3+
singleQuote = true

CHANGELOG.md

Whitespace-only changes.

MANIFEST.in

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
include LICENSE
2+
include README.md
3+
4+
recursive-include pythia_datasets *.py
5+
recursive-exclude * __pycache__
6+
recursive-exclude * data
7+
recursive-exclude * *.py[co]
8+
9+
include *.md
10+
include *.toml
11+
include *.txt
12+
prune tests*
13+
prune ci*
14+
prune data*

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,24 @@
11
# pythia-datasets
2+
3+
| CI | [![GitHub Workflow Status][github-ci-badge]][github-ci-link] [![GitHub Workflow Status][github-lint-badge]][github-lint-link] [![Code Coverage Status][codecov-badge]][codecov-link] |
4+
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
5+
| **Docs** | [![Documentation Status][rtd-badge]][rtd-link] |
6+
| **Package** | [![Conda][conda-badge]][conda-link] [![PyPI][pypi-badge]][pypi-link] |
7+
| **License** | [![License][license-badge]][repo-link] |
8+
29
Data repository for Project Pythia examples/notebooks
10+
11+
[github-ci-badge]: https://img.shields.io/github/workflow/status/ProjectPythia/pythia-datasets/CI?label=CI&logo=github&style=for-the-badge
12+
[github-lint-badge]: https://img.shields.io/github/workflow/status/ProjectPythia/pythia-datasets/linting?label=linting&logo=github&style=for-the-badge
13+
[github-ci-link]: https://github.com/ProjectPythia/pythia-datasets/actions?query=workflow%3ACI
14+
[github-lint-link]: https://github.com/ProjectPythia/pythia-datasets/actions?query=workflow%3Alinting
15+
[codecov-badge]: https://img.shields.io/codecov/c/github/ProjectPythia/pythia-datasets.svg?logo=codecov&style=for-the-badge
16+
[codecov-link]: https://codecov.io/gh/ProjectPythia/pythia-datasets
17+
[rtd-badge]: https://img.shields.io/readthedocs/ecgtools/latest.svg?style=for-the-badge
18+
[rtd-link]: https://ecgtools.readthedocs.io/en/latest/?badge=latest
19+
[pypi-badge]: https://img.shields.io/pypi/v/ecgtools?logo=pypi&style=for-the-badge
20+
[pypi-link]: https://pypi.org/project/ecgtools
21+
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/ecgtools?logo=anaconda&style=for-the-badge
22+
[conda-link]: https://anaconda.org/conda-forge/ecgtools
23+
[license-badge]: https://img.shields.io/github/license/ProjectPythia/pythia-datasets?style=for-the-badge
24+
[repo-link]: https://github.com/ProjectPythia/pythia-datasets

ci/environment.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: pythia-datasets
2+
channels:
3+
- conda-forge
4+
- nodefaults
5+
dependencies:
6+
- pip
7+
- pooch
8+
- pre-commit
9+
- pytest-cov
10+
- rich
11+
- typer

codecov.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
codecov:
2+
require_ci_to_pass: no
3+
max_report_age: off
4+
5+
comment: false
6+
7+
ignore:
8+
- 'tests/*.py'
9+
- 'setup.py'
10+
11+
coverage:
12+
precision: 2
13+
round: down
14+
status:
15+
project:
16+
default:
17+
target: 95
18+
informational: true
19+
patch: off
20+
changes: off

pyproject.toml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[tool.black]
2+
line-length = 100
3+
target-version = ['py38']
4+
skip-string-normalization = true
5+
6+
[tool.check-manifest]
7+
ignore = ["docs/*", "tests/*", "ci/*"]

pythia_datasets/__init__.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python3
2+
# flake8: noqa
3+
"""Top-level module for pythia-datasets ."""
4+
from pkg_resources import DistributionNotFound, get_distribution
5+
6+
try:
7+
__version__ = get_distribution(__name__).version
8+
except DistributionNotFound: # pragma: no cover
9+
# package is not installed
10+
__version__ = 'unknown' # pragma: no cover

pythia_datasets/registry.txt

Whitespace-only changes.

requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
typer>=0.3
2+
rich>=9.10.0
3+
pooch

setup.cfg

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[flake8]
2+
exclude = docs
3+
ignore =
4+
max-line-length = 100
5+
max-complexity = 18
6+
select = B,C,E,F,W,T4,B9
7+
extend-ignore = E203,E501,E402,W605
8+
9+
[isort]
10+
known_first_party=pythia_datasets
11+
known_third_party=pkg_resources,setuptools
12+
multi_line_output=3
13+
include_trailing_comma=True
14+
force_grid_wrap=0
15+
combine_as_imports=True
16+
line_length=100
17+
skip=
18+
docs/source/conf.py
19+
setup.py

setup.py

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env python3
2+
3+
"""The setup script."""
4+
5+
from setuptools import find_packages, setup
6+
7+
with open('requirements.txt') as f:
8+
requirements = f.read().strip().split('\n')
9+
10+
with open('README.md') as f:
11+
long_description = f.read()
12+
setup(
13+
maintainer='Project Pythia Team',
14+
maintainer_email='',
15+
python_requires='>=3.7',
16+
classifiers=[
17+
'Development Status :: 2 - Pre-Alpha',
18+
'License :: OSI Approved :: Apache Software License',
19+
'Natural Language :: English',
20+
'Programming Language :: Python :: 3',
21+
'Programming Language :: Python :: 3.7',
22+
'Programming Language :: Python :: 3.8',
23+
'Programming Language :: Python :: 3.9',
24+
'Topic :: Scientific/Engineering',
25+
'Operating System :: OS Independent',
26+
'Intended Audience :: Science/Research',
27+
],
28+
description='Provides utility functions for accessing data repository for Project Pythia examples/notebooks',
29+
install_requires=requirements,
30+
license='Apache Software License 2.0',
31+
long_description_content_type='text/markdown',
32+
long_description=long_description,
33+
include_package_data=True,
34+
keywords='Pythia, Pooch',
35+
name='pythia-datasets',
36+
packages=find_packages(include=['pythia_datasets', 'pythia_datasets.*']),
37+
entry_points={},
38+
url='https://github.com/ProjectPythia/pythia-datasets',
39+
project_urls={
40+
'Documentation': 'https://github.com/ProjectPythia/pythia-datasets',
41+
'Source': 'https://github.com/ProjectPythia/pythia-datasets',
42+
'Tracker': 'https://github.com/ProjectPythia/pythia-datasets/issues',
43+
},
44+
use_scm_version={
45+
'version_scheme': 'post-release',
46+
'local_scheme': 'dirty-tag',
47+
},
48+
setup_requires=['setuptools_scm', 'setuptools>=30.3.0'],
49+
zip_safe=False,
50+
)

tests/test_sample.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_access():
2+
assert 4 == 4

0 commit comments

Comments
 (0)