Skip to content

Commit 8714281

Browse files
committed
refactor: unify settings and build to pyproject.toml
1 parent dea55ae commit 8714281

23 files changed

+289
-308
lines changed

.dockerignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.editorconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ root = true
66

77

88
[*]
9-
109
# Change these settings to your own preference
1110
indent_style = space
1211
indent_size = 4
@@ -19,3 +18,6 @@ insert_final_newline = true
1918

2019
[*.md]
2120
trim_trailing_whitespace = false
21+
22+
[*.yml]
23+
indent_size = 2

.github/workflows/ci.yaml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: ci
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: [3.8]
11+
steps:
12+
- name: Check out code
13+
uses: actions/checkout@v3
14+
- name: Set up Python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
cache: "pip"
19+
- name: Install Dependencies
20+
run: |
21+
python -m venv venv
22+
source venv/bin/activate
23+
pip install -e ".[dev]"
24+
- name: Check Formatting
25+
run: |
26+
source venv/bin/activate
27+
inv lint-black
28+
- name: Check Linting
29+
run: |
30+
source venv/bin/activate
31+
inv lint-pylint
32+
- name: Check Types
33+
run: |
34+
source venv/bin/activate
35+
inv lint-mypy
36+
- name: Test
37+
run: |
38+
source venv/bin/activate
39+
inv test

.github/workflows/release_helper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
base: dev
105105
title: "chore: sync main->dev"
106106
labels: chore
107-
# reviewers:
107+
# reviewers:
108108
assignees: melange396
109109
body: |
110110
Syncing Main->Dev.

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
.mypy_cache
22
*.pyc
33
__pycache__
4-
/venv
5-
/docs/_build
64
.coverage
75
.pytest_cache
6+
.DS_Store
87
*.egg-info
9-
/dist
10-
.DS_Store
8+
dist/
9+
build/
10+
docs/_build
11+
venv/

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.5.1
5+
hooks:
6+
# Run the linter.
7+
- id: ruff
8+
args: [--fix]
9+
# Run the formatter.
10+
- id: ruff-format

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ Install with the following commands:
1212
# Latest dev version
1313
pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
1414

15-
# PyPI version
15+
# PyPI version (not yet available)
1616
pip install epidatpy
1717
```
1818

1919
## Usage
2020

2121
TODO
2222

23-
## Development Environment
23+
## Development
2424

2525
Prepare virtual environment and install dependencies
2626

2727
```sh
2828
python -m venv venv
2929
source ./venv/bin/activate
30-
pip install --use-feature=2020-resolver -r requirements.txt -r requirements-dev.txt
30+
pip install -e ".[dev]"
3131
```
3232

3333
### Common Commands
@@ -44,7 +44,7 @@ inv dist # build distribution packages
4444
inv release # upload the current version to pypi
4545
```
4646

47-
## Release Process
47+
### Release Process
4848

4949
The release consists of multiple steps which can be all done via the GitHub website:
5050

epidatpy/__init__.py

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,52 @@
11
"""Fetch data from Delphi's API."""
22

3+
# Make the linter happy about the unused variables
4+
__all__ = [
5+
"get_api_key",
6+
"__version__",
7+
"CovidcastDataSources",
8+
"DataSignal",
9+
"DataSignalGeoStatistics",
10+
"DataSource",
11+
"GeoType",
12+
"TimeType",
13+
"WebLink",
14+
"AEpiDataEndpoints",
15+
"AEpiDataCall",
16+
"EpiDataFormatType",
17+
"EpiDataResponse",
18+
"EpiRange",
19+
"EpiRangeDict",
20+
"EpiRangeLike",
21+
"EpiRangeParam",
22+
"IntParam",
23+
"InvalidArgumentException",
24+
"StringParam",
25+
]
26+
__author__ = "Delphi Research Group"
27+
28+
29+
from ._auth import get_api_key
330
from ._constants import __version__
31+
from ._covidcast import (
32+
CovidcastDataSources,
33+
DataSignal,
34+
DataSignalGeoStatistics,
35+
DataSource,
36+
GeoType,
37+
TimeType,
38+
WebLink,
39+
)
40+
from ._endpoints import AEpiDataEndpoints
441
from ._model import (
42+
AEpiDataCall,
43+
EpiDataFormatType,
44+
EpiDataResponse,
545
EpiRange,
646
EpiRangeDict,
7-
EpiDataResponse,
847
EpiRangeLike,
9-
InvalidArgumentException,
1048
EpiRangeParam,
1149
IntParam,
50+
InvalidArgumentException,
1251
StringParam,
13-
EpiDataFormatType,
14-
AEpiDataCall,
1552
)
16-
from ._covidcast import (
17-
DataSignal,
18-
DataSource,
19-
WebLink,
20-
DataSignalGeoStatistics,
21-
CovidcastDataSources,
22-
GeoType,
23-
TimeType,
24-
)
25-
from ._auth import get_api_key
26-
27-
__author__ = "Delphi Group"

epidatpy/_constants.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import Final
22

3-
43
__version__: Final = "0.5.0"
54
HTTP_HEADERS: Final = {"User-Agent": f"epidatpy/{__version__}"}
65
BASE_URL: Final = "https://api.delphi.cmu.edu/epidata/"

0 commit comments

Comments
 (0)