Skip to content

Commit

Permalink
switch to pdm
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
  • Loading branch information
Lawouach committed Apr 19, 2024
1 parent d112dfc commit f77a814
Show file tree
Hide file tree
Showing 11 changed files with 3,275 additions and 147 deletions.
30 changes: 8 additions & 22 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ssh-key: "${{secrets.CI_SSH_KEY}}"
fetch-depth: '0'
persist-credentials: true
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.8"
- name: Prepare Release
env:
GH_EMAIL: ${{ secrets.GH_EMAIL }}
Expand All @@ -25,51 +29,33 @@ jobs:
git config --global user.email "${GH_EMAIL}"
git config --global user.name "${GH_USERNAME}"
pip3 install -U --quiet --prefer-binary pip semver requests
echo "Creating a new tag if needed"
# keep track of any change in dependencies we must not carry around in the
# next tag
cp requirements-chaostoolkit.txt master-requirements-chaostoolkit.txt
cp update-requirements.py master-update-requirements.py
# moving to the latest tag (if one found)
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
if [[ $? == 0 ]]; then
git checkout $latest_tag
fi
echo "Latest tag was: ${latest_tag}"
cp master-update-requirements.py update-requirements.py
python3 update-requirements.py
echo "Removing temporary files"
git checkout update-requirements.py
rm master-requirements-chaostoolkit.txt master-update-requirements.py
pdm update --update-eager
# today's version (suffixed if more than one per-day)
# potential race condition here when multiple concurrent builds
# let's assume it won't happen very often and we can fix it manually
# Simplicity...
export CAL_VERSION=`python3 get-next-version.py`
rm -f has_changes.txt
git stash push requirements-chaostoolkit.txt
git checkout stash -- .
#git stash show -p | git apply && git stash drop || true
# echo "Pushing the new version and set of dependencies"
echo ${CAL_VERSION} > VERSION
git status
git add VERSION
git add requirements-chaostoolkit.txt
git add pdm.lock
git commit -s -m "Prepare ${CAL_VERSION}"
echo "Tagging release"
changes=`cat requirements-chaostoolkit.txt`
git tag -a ${CAL_VERSION} -m "$(printf "Release ${CAL_VERSION}\n\nContains:\n${changes}")"
git tag -a ${CAL_VERSION} -m "$(printf "Release ${CAL_VERSION}\n\n")"
git push --follow-tags origin "${CAL_VERSION}"
echo "Tag ${CAL_VERSION} pushed"
25 changes: 18 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.11"
- name: Install dependencies
run: pip3 install -U --prefer-binary pyasn1-modules -r requirements.txt -r requirements-extra.txt -r requirements-chaostoolkit.txt
run: pdm install --prod -G chaostoolkit -G extra
- name: Build for Linux
run: |
export CHAOSTOOLKIT_PATH=`which chaos`
Expand All @@ -34,9 +38,13 @@ jobs:
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.11"
- name: Install dependencies
run: pip3 install -U --prefer-binary -r requirements.txt -r requirements-extra.txt -r requirements-chaostoolkit.txt
run: pdm install --prod -G chaostoolkit -G extra
- name: Build for MacOSX
run: |
export CHAOSTOOLKIT_PATH=`which chaos`
Expand All @@ -59,10 +67,13 @@ jobs:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip3 install -U --prefer-binary wheel -r requirements.txt -r requirements-extra.txt -r requirements-chaostoolkit.txt
run: pdm install --prod -G chaostoolkit -G extra
- name: Build for Windows
run: |
$env:CHAOSTOOLKIT_PATH=$(python -c "import importlib;print(importlib.import_module('chaostoolkit.__main__').__file__)")
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,7 @@ venv.bak/
# mypy
.mypy_cache/

!chaos.spec
!chaos.spec

# pdm
.pdm-python
15 changes: 10 additions & 5 deletions hooks/hook-chaostracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@

datas = copy_metadata('chaostoolkit-opentracing', recursive=True) + \
copy_metadata('opentelemetry-api', recursive=True) + \
copy_metadata('opentelemetry-exporter-jaeger-proto-grpc', recursive=True) + \
copy_metadata('opentelemetry-exporter-otlp-proto-grpc', recursive=True) + \
copy_metadata('opentelemetry-sdk', recursive=True) + \
copy_metadata('opentelemetry-exporter-otlp-proto-http', recursive=True) + \
copy_metadata('opentelemetry-opentracing-shim', recursive=True) + \
copy_metadata('opentelemetry-exporter-jaeger-thrift', recursive=True) + \
copy_metadata('opentelemetry-propagator-b3', recursive=True) + \
copy_metadata('opentelemetry-sdk', recursive=True)
copy_metadata('opentelemetry-semantic-conventions', recursive=True) + \
copy_metadata('opentelemetry-instrumentation-httpx', recursive=True) + \
copy_metadata('opentelemetry-instrumentation-requests', recursive=True) + \
copy_metadata('opentelemetry-instrumentation-botocore', recursive=True) + \
copy_metadata('opentelemetry-exporter-gcp-trace', recursive=True) + \
copy_metadata('opentelemetry-resourcedetector-gcp', recursive=True) + \
copy_metadata('opentelemetry-sdk-extension-aws', recursive=True) + \
copy_metadata('opentelemetry-propagator-aws-xray', recursive=True) + \
copy_metadata('opentelemetry-instrumentation-urllib3', recursive=True)
hiddenimports = (
collect_submodules('chaostracing')
) + (
Expand Down
Loading

0 comments on commit f77a814

Please sign in to comment.