Skip to content

Commit

Permalink
Merge pull request #314 from rsheftel/dev
Browse files Browse the repository at this point in the history
v4.3.3 release
  • Loading branch information
rsheftel committed Dec 31, 2023
2 parents 3a43b5b + a78960c commit 81c5f5d
Show file tree
Hide file tree
Showing 55 changed files with 669 additions and 394 deletions.
1 change: 0 additions & 1 deletion .github/config_new_release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

new_version: '4.3.2'

change_log: |
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/check_branch.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: check_branch
on:
pull_request_target:
branches:
- master

workflow_dispatch:
name: check_branch
on:
pull_request_target:
branches:
- master

jobs:
wrong_branch:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.head.repo.fork || github.head_ref != 'dev' }}

steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: Please re-open this PR against the dev branch. For more information, consult CONTRIBUTING.md.
- run: echo PR against master that is not based on dev && exit 1
workflow_dispatch:

jobs:
wrong_branch:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.head.repo.fork || github.head_ref != 'dev' }}

steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: Please re-open this PR against the dev branch. For more information, consult CONTRIBUTING.md.
- run: echo PR against master that is not based on dev && exit 1

70 changes: 35 additions & 35 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
name: releaser
on:
push:
branches: [master]
branches: [ master ]

env:
NEWV: ''
OLDV: ''

jobs:
jobs:
run_tests:
uses: ./.github/workflows/test_runner.yml

make_new_release:
needs: run_tests
runs-on: ubuntu-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: get new_version
- name: get new_version
id: new_version
uses: KJ002/read-yaml@1.6
uses: KJ002/read-yaml@1.6
with:
file: .github/config_new_release.yml
file: .github/config_new_release.yml
key-path: '["new_version"]'

- name: get_new_current_version
run: |
run: |
echo "NEWV=${{ steps.new_version.outputs.data }}" >> $GITHUB_ENV
echo "OLDV=$(grep "VERSION" -m1 pyproject.toml | cut -d"=" -f2 | sed "s/['\" ]//g")" >> $GITHUB_ENV
- name: verify ${{env.NEWV}} > ${{env.OLDV}}
if: ${{ env.NEWV <= env.OLDV }}
run: echo you did not increment the version number && exit 1

- name: get changes
id: changes
uses: KJ002/read-yaml@1.6
uses: KJ002/read-yaml@1.6
with:
file: .github/config_new_release.yml
key-path: '["change_log"]'
file: .github/config_new_release.yml
key-path: '["change_log"]'

- name: get body
id: body
uses: KJ002/read-yaml@1.6
uses: KJ002/read-yaml@1.6
with:
file: .github/config_new_release.yml
key-path: '["release_body"]'
file: .github/config_new_release.yml
key-path: '["release_body"]'

- name: update change log
run: |
sed 5q docs/change_log.rst > docs/new_log.rst
Expand All @@ -58,8 +58,8 @@ jobs:
mv docs/new_log.rst docs/change_log.rst
- name: set up new version
run: |
sed -i "s/$OLDV/$NEWV/" pyproject.toml
run: |
sed -i "s/$OLDV/$NEWV/" pyproject.toml
- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -70,44 +70,44 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install build twine jupyter pytest
- name: build package
run: python -m build

- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

- name: install from pypi
run: |
while [ "$NEWV" != $(pip index versions pandas_market_calendars | cut -d'(' -f2 | cut -d')' -f1 | sed 1q) ];\
do echo not found yet, sleeping 5s; sleep 5s; done
pip install pandas_market_calendars==$NEWV
while [ "$NEWV" != $(pip index versions pandas_market_calendars | cut -d'(' -f2 | cut -d')' -f1 | sed 1q) ];\
do echo not found yet, sleeping 5s; sleep 5s; done
pip install pandas_market_calendars==$NEWV
- name: run tests
run: |
pip install .
mv pandas_market_calendars pandas_market_calendars_copy
python -c 'import pandas_market_calendars;print(pandas_market_calendars.__version__)'
pytest tests
pip install .
mv pandas_market_calendars pandas_market_calendars_copy
python -c 'import pandas_market_calendars;print(pandas_market_calendars.__version__)'
pytest tests
- name: prepare usage.rst
run: |
sudo apt install pandoc
jupyter nbconvert --execute --ExecutePreprocessor.kernel_name='python3' --to rst --output-dir docs --output usage.rst examples/usage.ipynb
- uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: pyproject.toml docs/change_log.rst docs/usage.rst
commit_message: '[GH-Actions] v${{ env.NEWV }} -- updated configuration and documentation files.'
- name: Create Release

- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: v${{ env.NEWV }}
tag_name: v${{ env.NEWV }}
body: |
body: |
Changes:
${{ steps.changes.outputs.data }}
Expand Down
174 changes: 87 additions & 87 deletions .github/workflows/test_release.yml
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
name: test_release
on:
pull_request:
branches: [master]
workflow_dispatch:
env:
NEWV: ""
OLDV: ""

jobs:
check:
runs-on: ubuntu-latest
steps:
- if: ${{ github.event.pull_request.head.repo.fork || github.head_ref != 'dev' }}
run: echo PR against main that is not based on dev && exit 1

run_tests:
needs: check
uses: ./.github/workflows/test_runner.yml
name: test_release
on:
pull_request:
branches: [ master ]

workflow_dispatch:

env:
NEWV: ""
OLDV: ""

jobs:
check:
runs-on: ubuntu-latest
steps:
- if: ${{ github.event.pull_request.head.repo.fork || github.head_ref != 'dev' }}
run: echo PR against main that is not based on dev && exit 1

run_tests:
needs: check
uses: ./.github/workflows/test_runner.yml

test_new_release:
needs: run_tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: get new_version
id: new_version
uses: KJ002/read-yaml@1.6
with:
file: .github/config_new_release.yml
key-path: '["new_version"]'
- name: get_new_current_version
run: |
echo "NEWV=${{ steps.new_version.outputs.data }}" >> $GITHUB_ENV
echo "OLDV=$(grep "VERSION" -m1 pyproject.toml | cut -d"=" -f2 | sed "s/['\" ]//g")" >> $GITHUB_ENV
- name: warn_no_version
if: ${{ env.NEWV <= env.OLDV }}
uses: thollander/actions-comment-pull-request@v1
with:
message: WARNING - Version number in change_log is not incremented. Will not test release.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: exit_no_version
if: ${{ env.NEWV <= env.OLDV }}
run: echo you did not update the change_log && exit 1
- name: make rc vnumber
run: echo "NEWV=${{env.NEWV}}rc${{github.run_number}}.dev${{github.run_attempt}}" >> $GITHUB_ENV
- name: set version
run: |
echo release candidate: $NEWV
sed -i "s/$OLDV/$NEWV/" pyproject.toml
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
pip install --upgrade pip
pip install build twine pytest
- name: Build source distribution and wheel files
run: python -m build

- name: Upload files to TestPyPI
run: python -m twine upload --verbose --repository testpypi dist/* -u__token__ -p${{ secrets.TEST_PYPI_TOKEN }}

- name: Install from testpypi
run: |
while [ "$NEWV" != $(pip index versions -i https://test.pypi.org/simple --pre pandas_market_calendars | cut -d'(' -f2 | cut -d')' -f1 | sed 1q) ];\
do echo not found yet, sleeping 5s; sleep 5s; done
pip install -i https://test.pypi.org/simple pandas_market_calendars==$NEWV --no-deps
- name: test new release
run: |
pip install .
mv pandas_market_calendars pandas_market_calendars_copy
python -c 'import pandas_market_calendars;print(pandas_market_calendars.__version__)'
pytest tests
test_new_release:
needs: run_tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: get new_version
id: new_version
uses: KJ002/read-yaml@1.6
with:
file: .github/config_new_release.yml
key-path: '["new_version"]'

- name: get_new_current_version
run: |
echo "NEWV=${{ steps.new_version.outputs.data }}" >> $GITHUB_ENV
echo "OLDV=$(grep "VERSION" -m1 pyproject.toml | cut -d"=" -f2 | sed "s/['\" ]//g")" >> $GITHUB_ENV
- name: warn_no_version
if: ${{ env.NEWV <= env.OLDV }}
uses: thollander/actions-comment-pull-request@v1
with:
message: WARNING - Version number in change_log is not incremented. Will not test release.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: exit_no_version
if: ${{ env.NEWV <= env.OLDV }}
run: echo you did not update the change_log && exit 1

- name: make rc vnumber
run: echo "NEWV=${{env.NEWV}}rc${{github.run_number}}.dev${{github.run_attempt}}" >> $GITHUB_ENV

- name: set version
run: |
echo release candidate: $NEWV
sed -i "s/$OLDV/$NEWV/" pyproject.toml
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
pip install --upgrade pip
pip install build twine pytest
- name: Build source distribution and wheel files
run: python -m build

- name: Upload files to TestPyPI
run: python -m twine upload --verbose --repository testpypi dist/* -u__token__ -p${{ secrets.TEST_PYPI_TOKEN }}

- name: Install from testpypi
run: |
while [ "$NEWV" != $(pip index versions -i https://test.pypi.org/simple --pre pandas_market_calendars | cut -d'(' -f2 | cut -d')' -f1 | sed 1q) ];\
do echo not found yet, sleeping 5s; sleep 5s; done
pip install -i https://test.pypi.org/simple pandas_market_calendars==$NEWV --no-deps
- name: test new release
run: |
pip install .
mv pandas_market_calendars pandas_market_calendars_copy
python -c 'import pandas_market_calendars;print(pandas_market_calendars.__version__)'
pytest tests
Loading

0 comments on commit 81c5f5d

Please sign in to comment.