Skip to content

Commit b8897d7

Browse files
authored
Merge branch 'dev' into ndefries/flusurv-new-columns
2 parents b18c898 + 2487f8b commit b8897d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2346
-1517
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

.git-blame-ignore-revs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Run repo through formatter
2+
c7831fc0fa1367d8517831996539ce0c6c48aa58
3+
# Run repo through formatter
4+
57908fc0099685a6cad6bfe6996182e6295411df

.github/workflows/ci.yaml

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

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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@v4
14+
- name: Set up Python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
cache: "pip"
19+
- name: Install Dependencies
20+
run: |
21+
make install
22+
- name: Check Formatting
23+
run: |
24+
make lint_ruff
25+
- name: Check Linting
26+
run: |
27+
make lint_pylint
28+
- name: Check Types
29+
run: |
30+
make lint_mypy
31+
- name: Test
32+
run: |
33+
make test

.github/workflows/create_release.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ on:
66
description: "Semantic Version Number (i.e., 5.5.0 or patch, minor, major, prepatch, preminor, premajor, prerelease)"
77
required: true
88
default: patch
9+
910
jobs:
1011
create_release:
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Check out code
14-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1516
with:
1617
ref: main
1718
ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }}
@@ -20,24 +21,38 @@ jobs:
2021
git fetch origin dev:dev
2122
git reset --hard dev
2223
- name: Set up Python 3.8
23-
uses: actions/setup-python@v2
24+
uses: actions/setup-python@v5
2425
with:
2526
python-version: 3.8
2627
- name: Change version number
2728
id: version
29+
# See this issue for explanation and testing:
30+
# https://github.com/cmu-delphi/delphi-epidata/pull/1473
2831
run: |
2932
python -m pip install bump2version
30-
echo -n "::set-output name=next_tag::"
31-
bump2version --list ${{ github.event.inputs.versionName }} | grep new_version | sed -r s,"^.*=",,
33+
if [[ ${{ github.event.inputs.versionName }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
34+
# use given version number
35+
NEXT_TAG="${{ github.event.inputs.versionName }}"
36+
elif [[ ${{ github.event.inputs.versionName }} =~ ^(major|minor|patch)$ ]]; then
37+
# calculate new version number based on given tag
38+
NEXT_TAG=$(bump2version --dry-run --list ${{ github.event.inputs.versionName }} | grep ^new_version | sed -r s,"^.*=",,)
39+
else
40+
echo "\nInvalid version name: ${{ github.event.inputs.versionName }}"
41+
exit 1
42+
fi
43+
# apply given or calculated version number
44+
bump2version --new-version $NEXT_TAG _ignored_arg_
45+
# save version number for later
46+
echo "next_tag=$NEXT_TAG" >> $GITHUB_OUTPUT
3247
- name: Create pull request into main
33-
uses: peter-evans/create-pull-request@v3
48+
uses: peter-evans/create-pull-request@v6
3449
with:
3550
branch: release/${{ steps.version.outputs.next_tag }}
3651
commit-message: "chore: release ${{ steps.version.outputs.next_tag }}"
3752
base: main
3853
title: Release ${{ steps.version.outputs.next_tag }}
3954
labels: chore
4055
# reviewers:
41-
assignees: melange396
56+
assignees: dshemetov
4257
body: |
4358
Releasing ${{ steps.version.outputs.next_tag }}.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
docs:
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
DELPHI_EPIDATA_KEY: ${{ secrets.DELPHI_GITHUB_ACTIONS_EPIDATA_API_KEY }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- uses: actions/setup-python@v5
22+
- name: Install dependencies
23+
run: |
24+
python3.8 -m venv .venv
25+
.venv/bin/python -m pip install --upgrade pip
26+
.venv/bin/pip install -e ".[dev]"
27+
- uses: siacodelabs/setup-pandoc@v1
28+
- name: Sphinx build
29+
run: |
30+
.venv/bin/sphinx-build -b html docs docs/_build
31+
- name: Deploy to GitHub Pages
32+
uses: peaceiris/actions-gh-pages@v3
33+
with:
34+
publish_branch: gh-pages
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: docs/_build/
37+
force_orphan: true

.github/workflows/release_helper.yml

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Check out code
20-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
2121
- name: Set up Python 3.8
22-
uses: actions/setup-python@v2
22+
uses: actions/setup-python@v5
2323
with:
2424
python-version: 3.8
2525
- name: Extract version
2626
id: extract_version
2727
run: |
2828
python -m pip install bump2version
29-
echo -n "::set-output name=version::"
30-
bump2version --dry-run --list patch | grep ^current_version | sed -r s,"^.*=",,
29+
NEXT_TAG=$(bump2version --dry-run --list patch | grep ^current_version | sed -r s,"^.*=",,)
30+
echo "version=$NEXT_TAG" >> $GITHUB_OUTPUT
3131
- name: Create Release
3232
id: create_release
33-
uses: release-drafter/release-drafter@v5
33+
uses: release-drafter/release-drafter@v6
3434
env:
3535
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3636
with:
@@ -41,54 +41,75 @@ jobs:
4141
upload_url: ${{ steps.create_release.outputs.upload_url }}
4242
tag_name: ${{ steps.create_release.outputs.tag_name }}
4343

44-
release_package:
45-
needs: create_release
44+
lint:
4645
runs-on: ubuntu-latest
4746
steps:
4847
- name: Check out code
49-
uses: actions/checkout@v2
48+
uses: actions/checkout@v4
5049
- name: Set up Python 3.8
51-
uses: actions/setup-python@v2
50+
uses: actions/setup-python@v5
5251
with:
5352
python-version: 3.8
5453
- name: Install build dependencies
5554
run: |
56-
python -m pip install --upgrade pip
57-
pip install --use-feature=2020-resolver -r requirements.txt -r requirements-dev.txt
55+
make install
5856
- name: Linting
5957
run: |
60-
. venv/bin/activate
61-
inv lint
58+
make lint
6259
- name: Testing
6360
run: |
64-
. venv/bin/activate
65-
inv test
66-
- name: Create release
61+
make test
62+
63+
build:
64+
needs: [create_release, lint]
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Check out code
68+
uses: actions/checkout@v4
69+
- name: Set up Python 3.8
70+
uses: actions/setup-python@v5
71+
with:
72+
python-version: 3.8
73+
- name: Install build dependencies
74+
run: |
75+
make install
76+
- name: Build
6777
run: |
68-
inv dist
69-
- uses: actions/upload-artifact@v2
78+
make dist
79+
80+
release_package:
81+
needs: [create_release, lint]
82+
runs-on: ubuntu-latest
83+
# TODO: Make sure this works, copied from best practices here
84+
# https://github.com/pypa/gh-action-pypi-publish/tree/release/v1/?tab=readme-ov-file#trusted-publishing
85+
environment:
86+
name: pypi
87+
url: https://pypi.org/p/epidatpy
88+
permissions:
89+
id-token: write
90+
steps:
91+
- uses: actions/upload-artifact@v4
7092
with:
7193
name: epidatpy
94+
path: dist/*.tar.gz
7295
- name: Upload Release Asset
73-
uses: AButler/upload-release-assets@v2.0
96+
uses: AButler/upload-release-assets@v3.0
7497
with:
7598
files: "dist/*.tar.gz"
7699
repo-token: ${{ secrets.GITHUB_TOKEN }}
77100
release-tag: ${{ needs.create_release.outputs.tag_name }}
78101
- name: Publish a Python distribution to PyPI
79102
uses: pypa/gh-action-pypi-publish@release/v1
80103
with:
81-
user: __token__
82-
password: ${{ secrets.DELPHI_PYPI_PROD_TOKEN }}
83-
skip_existing: true
104+
skip-existing: true
84105
# repository_url: https://test.pypi.org/legacy/
85106

86107
sync_dev:
87108
needs: correct_repository
88109
runs-on: ubuntu-latest
89110
steps:
90111
- name: Check out code
91-
uses: actions/checkout@v2
112+
uses: actions/checkout@v4
92113
with:
93114
ref: dev
94115
ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }}
@@ -97,14 +118,14 @@ jobs:
97118
git fetch origin main:main
98119
git reset --hard main
99120
- name: Create pull request into dev
100-
uses: peter-evans/create-pull-request@v3
121+
uses: peter-evans/create-pull-request@v6
101122
with:
102123
branch: bot/sync-main-dev
103124
commit-message: "chore: sync main-dev"
104125
base: dev
105126
title: "chore: sync main->dev"
106127
labels: chore
107-
# reviewers:
108-
assignees: melange396
128+
# reviewers:
129+
assignees: dshemetov
109130
body: |
110131
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/

.pylintrc

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

0 commit comments

Comments
 (0)