Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lbesnard committed May 30, 2024
1 parent 6186c1e commit 6b4e182
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 163 deletions.
67 changes: 36 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,63 @@
name: Release
name: Automated Release

on:
push:
tags:
- 'v*.*.*'

jobs:
release:
build-and-release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10.14'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install bump2version
python setup.py install
- name: Bump version
- name: Install Poetry
run: |
bump2version patch # You can change this to major/minor as needed
curl -sSL https://install.python-poetry.org | python3 -
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POETRY_HOME: ${{ runner.temp }}/poetry

- name: Add Poetry to PATH
run: echo "${{ runner.temp }}/poetry/bin" >> $GITHUB_PATH

- name: Install dependencies
run: poetry install

- name: Run tests
run: poetry run pytest

- name: Build package
run: poetry build

- name: Publish package
run: poetry publish --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }}

- name: Configure git for committing version bump
run: |
python setup.py sdist bdist_wheel
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Bump version
id: bump_version
run: |
NEW_VERSION=$(poetry version patch | awk '{print $2}')
echo "New version: $NEW_VERSION"
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
git commit -am "Bump version to $NEW_VERSION"
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/*
asset_name: my_package-${{ github.ref }}.tar.gz # Adjust based on your build output
asset_content_type: application/gzip
- name: Push version bump
run: |
git tag -a v${{ env.new_version }} -m "Release v${{ env.new_version }}"
git push --follow-tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

23 changes: 10 additions & 13 deletions .github/workflows/test-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,20 @@ jobs:
with:
python-version: '3.10.14'

- name: Install package dependencies
run: |
pip install .
- name: Install additional dependencies
- name: Install Poetry
run: |
pip install pytest coverage
curl -sSL https://install.python-poetry.org | python3 -
- name: Run setup.py install
- name: Install package dependencies
run: |
python setup.py install
poetry install
- name: Run tests with coverage
run: |
pytest
coverage run -m pytest
coverage report --fail-under=60
coverage xml -o coverage.xml
poetry run pytest
poetry run coverage run -m pytest
poetry run coverage report --fail-under=60
poetry run coverage xml -o coverage.xml
- name: Upload coverage report
uses: actions/upload-artifact@v2
Expand All @@ -51,8 +47,9 @@ jobs:

- name: Build package
run: |
python setup.py sdist bdist_wheel
poetry build
- name: Verify build
run: |
pip install dist/*.whl
64 changes: 50 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["poetry-core", "wheel"]
build-backend = "poetry.core.masonry.api"

#[tool.setuptools_scm]
#write_to = "aodndata/_version.py"

[project]
name = "aodn_cloud_optimised"
[tool.poetry]
name = "aodn-cloud-optimised"
version = "0.1.0"
description = "Cloud optimised data formats for IMOS NetCDF files and CSVs."
authors = [
{ name = "Laurent Besnard", email = "[email protected]" }
]
authors = ["lbesnard <[email protected]>"]
license = "GNU General Public License v3.0"
readme = "README.md"
version = "0.1.0"
license = { text = "GNU General Public License v3.0" }
keywords = ["cloud", "data", "NetCDF", "CSV", "Zarr", "Parquet"]
classifiers = [
"Development Status :: 3 - Alpha",
Expand All @@ -26,8 +21,49 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
]

[project.urls]
homepage = "https://github.com/aodn/aodn_cloud_optimised"

[tool.poetry.urls]
"Source code" = "https://github.com/aodn/aodn_cloud_optimised"


[tool.poetry.dependencies]
python = "==3.10.14"
netCDF4 = ">=1.6.5"
numpy = ">=1.26.4"
pandas = ">=2.2.2"
python-dateutil = ">=2.9.0"
jsonschema = ">=4.22.0"
h5py = ">=3.11.0"
scipy = ">=1.13.0"
boto3 = ">=1.34.100"
pyarrow = "==16.0.0"
rechunker = ">=0.5.2"
s3fs = ">=2024.3.1"
shapely = ">=2.0.4"
xarray = { version = ">=2024.3.0", extras = ["complete"] }
zarr = ">=2.18.0"

[tool.poetry.extras]
testing = ["pytest", "ipython", "ipdb"]
interactive = ["pytest", "ipython", "ipdb"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
aatams_acoustic_tagging = "aodn_cloud_optimised.bin.aatams_acoustic_tagging:main"
acorn_gridded_qc_turq = "aodn_cloud_optimised.bin.acorn_gridded_qc_turq:main"
anfog_to_parquet = "aodn_cloud_optimised.bin.anfog_to_parquet:main"
anmn_ctd_to_parquet = "aodn_cloud_optimised.bin.anmn_ctd_to_parquet:main"
anmn_hourly_timeseries = "aodn_cloud_optimised.bin.anmn_hourly_timeseries:main"
anmn_aqualogger_to_parquet = "aodn_cloud_optimised.bin.anmn_aqualogger_to_parquet:main"
ardc_wave_to_parquet = "aodn_cloud_optimised.bin.ardc_wave_to_parquet:main"
argo_to_parquet = "aodn_cloud_optimised.bin.argo_to_parquet:main"
gsla_nrt_to_zarr = "aodn_cloud_optimised.bin.gsla_nrt_to_zarr:main"
soop_xbt_nrt_to_parquet = "aodn_cloud_optimised.bin.soop_xbt_nrt_to_parquet:main"
srs_oc_ljco_to_parquet = "aodn_cloud_optimised.bin.srs_oc_ljco_to_parquet:main"
srs_l3s_1d_dn_to_zarr = "aodn_cloud_optimised.bin.srs_l3s_1d_dn_to_zarr:main"

[tool.poetry.include]
"*.json" = ["aodn_cloud_optimised/config/*.json", "aodn_cloud_optimised/config/dataset/*.json"]
105 changes: 0 additions & 105 deletions setup.py

This file was deleted.

0 comments on commit 6b4e182

Please sign in to comment.