Skip to content

Commit 585fbc3

Browse files
authored
Merge branch 'dev' into nsspDocs
2 parents fb7c54d + 10a0a6f commit 585fbc3

File tree

18 files changed

+883
-478
lines changed

18 files changed

+883
-478
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ tag = False
99

1010
[bumpversion:file:src/client/delphi_epidata.R]
1111

12-
[bumpversion:file:src/client/delphi_epidata.py]
13-
1412
[bumpversion:file:src/client/packaging/npm/package.json]
1513

16-
[bumpversion:file:src/client/packaging/pypi/setup.py]
17-
1814
[bumpversion:file:dev/local/setup.cfg]

.github/workflows/create-release.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
versionName:
7-
description: 'Semantic Version Number (i.e., 5.5.0 or patch, minor, major, prepatch, preminor, premajor, prerelease)'
7+
description: 'Semantic Version Number (i.e., 5.5.0 or patch, minor, major)'
88
required: true
99
default: patch
1010

@@ -27,11 +27,43 @@ jobs:
2727
python-version: 3.8
2828
- name: Change version number
2929
id: version
30+
# See this issue for explanation and testing:
31+
# https://github.com/cmu-delphi/delphi-epidata/pull/1473
3032
run: |
3133
python -m pip install bump2version
32-
echo -n "::set-output name=next_tag::"
33-
bump2version --list ${{ github.event.inputs.versionName }} | grep new_version | sed -r s,"^.*=",,
34-
- name: Create pull request into prod
34+
if [[ ${{ github.event.inputs.versionName }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
35+
# use given version number
36+
NEXT_TAG="${{ github.event.inputs.versionName }}"
37+
elif [[ ${{ github.event.inputs.versionName }} =~ ^(major|minor|patch)$ ]]; then
38+
# calculate new version number based on given tag
39+
NEXT_TAG=$(bump2version --dry-run --list ${{ github.event.inputs.versionName }} | grep ^new_version | sed -r s,"^.*=",,)
40+
else
41+
echo "\nInvalid version name: ${{ github.event.inputs.versionName }}"
42+
exit 1
43+
fi
44+
# apply given or calculated version number
45+
bump2version --new-version $NEXT_TAG _ignored_arg_
46+
# save version number for later
47+
echo "next_tag=$NEXT_TAG" >> $GITHUB_OUTPUT
48+
- name: Get Python client file changes
49+
id: changed-py
50+
uses: dorny/paths-filter@v3
51+
with:
52+
base: "main"
53+
ref: "dev"
54+
filters: |
55+
python_client_changed:
56+
- src/client/delphi_epidata.py
57+
- src/client/packaging/pypi/**
58+
- name: Bump Python versions if client files changed
59+
if: steps.changed-py.outputs.python_client_changed == 'true'
60+
# _ignored_arg_ below is required because of tool quirk
61+
# https://github.com/c4urself/bump2version/issues/22
62+
run: |
63+
cd src/client/packaging/pypi
64+
# this is using the new literal version number (steps.version.outputs.next_tag) output from the bump2version step above, not the workflow input (github.event.inputs.versionName) which can be relative
65+
bump2version --allow-dirty --new-version ${{ steps.version.outputs.next_tag }} _ignored_arg_
66+
- name: Create pull request into main
3567
uses: peter-evans/create-pull-request@v3
3668
with:
3769
branch: release/delphi-epidata-${{ steps.version.outputs.next_tag }}

.github/workflows/release-helper.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,29 @@ jobs:
1313
if: github.repository_owner != 'cmu-delphi'
1414
run: exit 1
1515

16+
client_changed:
17+
needs: correct_repository
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check out code
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 2
24+
- name: Get Python client file changes
25+
id: changed-py
26+
uses: dorny/paths-filter@v3
27+
with:
28+
# when base and ref are the same, changes are detected against the most recent commit before the push.
29+
# see https://github.com/dorny/paths-filter#usage for details.
30+
base: 'main'
31+
ref: 'main'
32+
filters: |
33+
python_client_changed:
34+
- src/client/delphi_epidata.py
35+
- src/client/packaging/pypi/**
36+
outputs:
37+
python_client_changed: ${{ steps.changed-py.outputs.python_client_changed }}
38+
1639
create_release:
1740
needs: correct_repository
1841
runs-on: ubuntu-latest
@@ -29,8 +52,8 @@ jobs:
2952
id: extract_version
3053
run: |
3154
python -m pip install bump2version
32-
echo -n "::set-output name=version::"
33-
bump2version --dry-run --list patch | grep ^current_version | sed -r s,"^.*=",,
55+
VERSION=$(bump2version --dry-run --list patch | grep ^current_version | sed -r s,"^.*=",,)
56+
echo "version=$VERSION" >> $GITHUB_OUTPUT
3457
- name: Create Release
3558
id: create_release
3659
uses: release-drafter/release-drafter@v5
@@ -45,7 +68,8 @@ jobs:
4568
tag_name: ${{ steps.create_release.outputs.tag_name }}
4669

4770
release_python_client:
48-
needs: create_release
71+
needs: [client_changed, create_release]
72+
if: needs.client_changed.outputs.python_client_changed == 'true'
4973
runs-on: ubuntu-latest
5074
steps:
5175
- name: Check out code
@@ -57,14 +81,14 @@ jobs:
5781
- name: Install build dependencies
5882
run: |
5983
python -m pip install --upgrade pip
60-
pip install wheel twine
84+
pip install build wheel twine
6185
- name: Prepare package
6286
run: |
6387
cp src/client/*.py src/client/packaging/pypi/delphi_epidata/
6488
- name: Create release
6589
working-directory: src/client/packaging/pypi
6690
run: |
67-
python setup.py sdist bdist_wheel
91+
python -m build --sdist --wheel
6892
- uses: actions/upload-artifact@v2
6993
with:
7094
name: delphi_epidata_py
@@ -80,8 +104,8 @@ jobs:
80104
with:
81105
user: __token__
82106
password: ${{ secrets.DELPHI_PYPI_PROD_TOKEN }}
83-
packages_dir: src/client/packaging/pypi/dist/
84-
skip_existing: true
107+
packages-dir: src/client/packaging/pypi/dist/
108+
skip-existing: true
85109
# repository_url: https://test.pypi.org/legacy/
86110

87111
release_js_client:
@@ -95,7 +119,7 @@ jobs:
95119
uses: actions/checkout@v2
96120
- uses: actions/setup-node@v2
97121
with:
98-
node-version: '16.x'
122+
node-version: "16.x"
99123
- name: Cache Node.js modules
100124
uses: actions/cache@v2
101125
with:
File renamed without changes.

docs/api/covidcast-signals/quidel.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,5 @@ not enough samples can be filled in from the parent state for smoothed signals s
159159
no data is reported for that area on that day; an API query for all reported geographic areas on
160160
that day will not include it.
161161

162-
## Flu Tests (inactive)
163-
These signals were updated until May 19, 2020. Documentation is still available on the [inactive Quidel page](quidel-inactive.md).
162+
## Flu Tests
163+
These signals are inactive. They were updated until May 19, 2020. Documentation is still available on the [Quidel influenza page](quidel-flu.md).
File renamed without changes.

docs/api/covidcast_licensing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Attribution license](https://creativecommons.org/licenses/by/4.0/):
3636

3737
* [Doctor Visits](covidcast-signals/doctor-visits.md)
3838
* [Hospital Admissions](covidcast-signals/hospital-admissions.md)
39-
* [Indicator Combination](covidcast-signals/indicator-combination-inactive.md): signals
39+
* [Indicator Combination](covidcast-signals/indicator-combination.md): signals
4040
with names beginning `nmf_*`
4141
* [Quidel](covidcast-signals/quidel.md)
4242
* [COVID-19 Trends and Impact Survey](covidcast-signals/fb-survey.md)
@@ -61,7 +61,7 @@ These data streams are essentially mirrors of their respective sources, and are
6161
published here subject to the original license provided by the source:
6262

6363
* [Google Health Trends](covidcast-signals/ght.md)
64-
* [Indicator Combination](covidcast-signals/indicator-combination-inactive.md): cases and
64+
* [Indicator Combination](covidcast-signals/indicator-combination.md): cases and
6565
deaths signals
6666
* [JHU Cases and Deaths](covidcast-signals/jhu-csse.md)
6767
* [SafeGraph Mobility](covidcast-signals/safegraph.md)

0 commit comments

Comments
 (0)