diff --git a/.github/release.yaml b/.github/release.yaml new file mode 100644 index 0000000..ebf9ad2 --- /dev/null +++ b/.github/release.yaml @@ -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 }} \ No newline at end of file diff --git a/.github/test.yaml b/.github/test.yaml new file mode 100644 index 0000000..230e89b --- /dev/null +++ b/.github/test.yaml @@ -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__)' + + diff --git a/airflow_anomaly_detection/__init__.py b/airflow_anomaly_detection/__init__.py index e366f01..5502af6 100644 --- a/airflow_anomaly_detection/__init__.py +++ b/airflow_anomaly_detection/__init__.py @@ -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__] } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 3b29434..2df4472 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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="andrewm4894@gmail.com" }, ]