Skip to content

Commit

Permalink
WIP: Test automated release with github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
fre171csiro committed Oct 30, 2023
1 parent 07f47ec commit abae60a
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Upload Python Package

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
# by default, it uses a depth of 1
# this fetches all history so that we can read each commit
fetch-depth: 0
- name: Generate Changelog
run: .github/release_message.sh > release_message.md
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: release_message.md

deploy:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
6 changes: 5 additions & 1 deletion pybomwater/bom_water.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,11 @@ def divide_chunks(self, l, n):


def define_request_chunking_size(self, features, property, procedure, start_date, end_date ):
request_values_limit = 500000
"""
This is a rough stab at determining a chunk size.
Trying to balance between making too many requests and a response size which is too large
"""
request_values_limit = 500000#BoM have a Constraint of 2000000 values specified however this does not seem real as the request fails if we try to get close to this value.
size = 2
feat_count = len(features)

Expand Down
2 changes: 1 addition & 1 deletion test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def test_duplicate_dates(self):
lower_left_coords = f'{low_left_lat} {low_left_long}'
upper_right_coords = f'{upper_right_lat} {upper_right_long}'
coords = tuple((lower_left_coords, upper_right_coords))
t_begin = "1920-01-01T00:00:00+10"
t_begin = "2000-01-01T00:00:00+10"
t_end = "2024-12-31T00:00:00+10"

spatial_path = './test/test_data/Spatial/test_filter_layer.shp'#os.path.join(spatial_test_data_path, 'mdb_buffer_1km.shp')
Expand Down

0 comments on commit abae60a

Please sign in to comment.