Skip to content

Commit

Permalink
refactor project
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 9, 2024
1 parent a1ed9ce commit 7067412
Show file tree
Hide file tree
Showing 18 changed files with 1,477 additions and 257 deletions.
58 changes: 29 additions & 29 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name: Build, Test, and Lint
name: Build

on:
pull_request:
branches:
- master
push:
branches:
- master
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-and-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
run: |
make install-dev
- name: Run linting
run: |
make lint
build-and-test:
runs-on: ubuntu-latest
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: ["ubuntu-latest", "macos-latest"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
cache: true
prerelease: true

- name: Ensure lock file is up to date
run: |
pdm lock --check
- name: Install dependencies
run: |
make install-dev
- name: Run tests
pdm sync -d
- name: Run Lint
run: |
pdm run lint
- name: Run Tests
run: |
make tests
pdm run pytest
4 changes: 2 additions & 2 deletions .github/workflows/check-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
check-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Check Changelog modified
uses: dangoslen/changelog-enforcer@v2
with:
Expand All @@ -17,7 +17,7 @@ jobs:
check-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Get changed files
id: files
uses: jitterbit/get-changed-files@v1
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
name: Release

on:
pull_request:
branches-ignore:
- 'master'
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]+'

jobs:
release-to-pypi:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: '3.7'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel twine
- name: Build and publish
cache: true
- name: Build
run: pdm build
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PWD }}
run: |
python3 setup.py release
twine upload dist/*
PDM_BUILD_SCM_VERSION: ${{github.ref_name}}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Upload packages as artifacts
uses: actions/upload-artifact@v2-preview
with:
name: chaostoolkit-opentracing-packages
path: dist/chaostoolkit_opentracing-*

create-gh-release:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Create Release
uses: actions/create-release@latest
Expand All @@ -46,7 +47,7 @@ jobs:
prerelease: false

upload-gh-release-assets:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs:
- create-gh-release
- release-to-pypi
Expand All @@ -59,7 +60,6 @@ jobs:
- name: Upload wheel & source dist to GH release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*.whl,dist/*.tar.gz"
artifact: ""
artifact: "dist/*.whl,dist/*.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,8 @@ ENV/

.DS_Store
junit-test-results.xml
.vscode/
.vscode/

# PDM
.pdm-python
.pdm-build/
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
### Fixed

- Added the ctk activity name in activity spans to enrich the user readability in backend tracing systems. [#5][ctk-opentracing-5]
- Switched to [PDM][pdm] to manage project
- Drop black and isort and keep ruff only
- Drop logzero and use the builtin logging module directly

[ctk-opentracing-5]: https://github.com/chaostoolkit-incubator/chaostoolkit-opentracing/issues/5
[pdm]: https://pdm-project.org/en/latest

## [0.16.1][] - 2023-12-18

Expand Down
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

25 changes: 0 additions & 25 deletions Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Here is an example of what it could look like with the Jaeger backend.

## Install

This package requires Python 3.6+
This package requires Python 3.8+

To be used from your experiment, this package must be installed in the Python
environment where [chaostoolkit][] already lives.
Expand Down Expand Up @@ -328,7 +328,7 @@ Use the following configuration:
To run the tests for the project execute the following:

```
$ pytest
$ pdm run test
```

## Contribute
Expand Down
Loading

0 comments on commit 7067412

Please sign in to comment.