Skip to content

Commit

Permalink
Merge pull request #7 from dylanbstorey/ci/cd
Browse files Browse the repository at this point in the history
github actions for ci/cd, minor __version__ refactor
  • Loading branch information
andrewm4894 authored Feb 15, 2023
2 parents d132516 + a07e9b8 commit a220ebd
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to Test PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
64 changes: 64 additions & 0 deletions .github/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Testing

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
FORCE_COLOR: "1" # Make tools pretty.
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_NO_PYTHON_VERSION_WARNING: "1"
SETUPTOOLS_SCM_PRETEND_VERSION: "1.0" # avoid warnings about shallow checkout
PYTHON_LATEST: "3.11"


jobs:
tests:
name: tests on ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: unit tests
run: |
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .
pytest -svvv tests/
install-dev:
name: Verify dev env
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{env.PYTHON_LATEST}}
- name: install and test import
run: |
python -m pip install -e .
python -c 'import airflow_provider_anomoly_detection; print(airflow_provider_anomoly_detection.__version__)'
5 changes: 4 additions & 1 deletion airflow_anomaly_detection/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@

__version__ = "0.0.16"

def get_provider_info():
return {
"package-name": "airflow-provider-anomaly-detection",
"name": "Anomaly Detection Airflow Provider",
"description": "An airflow provider for anomaly detection.",
"versions": ["0.0.16"]
"versions": [__version__]
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "airflow-provider-anomaly-detection"
version = "0.0.16"
version = attr: airflow_provider_anomaly_detection.__version__
authors = [
{ name="andrewm4894", email="[email protected]" },
]
Expand Down

0 comments on commit a220ebd

Please sign in to comment.