From 1ebe61a3cbe15b31d145c01e3eb6df67b298dd8b Mon Sep 17 00:00:00 2001 From: jarredSafegraph <91471796+jarredSafegraph@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:42:57 -0400 Subject: [PATCH 1/2] Added test --- run_test_query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_test_query.py b/run_test_query.py index 7f4efa5..9a1692b 100644 --- a/run_test_query.py +++ b/run_test_query.py @@ -1,4 +1,3 @@ -# run_test_query.py import os from placekey.api import PlacekeyAPI @@ -15,5 +14,6 @@ def main(): } print(api.lookup_placekeys([place], verbose=True)) + if __name__ == '__main__': main() From 506ae6990a1dd4d67d1949c880298dd19dc82fca Mon Sep 17 00:00:00 2001 From: jarredSafegraph <91471796+jarredSafegraph@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:51:00 -0400 Subject: [PATCH 2/2] Removed query test step #ci --- .../build-and-deploy-release-pypi.yml | 34 ++++++------------- run_test_query.py | 19 ----------- 2 files changed, 11 insertions(+), 42 deletions(-) delete mode 100644 run_test_query.py diff --git a/.github/workflows/build-and-deploy-release-pypi.yml b/.github/workflows/build-and-deploy-release-pypi.yml index d151d0c..5d133c0 100644 --- a/.github/workflows/build-and-deploy-release-pypi.yml +++ b/.github/workflows/build-and-deploy-release-pypi.yml @@ -1,10 +1,9 @@ name: Build and Upload Python Package -# on: -# release: -# types: [push] + on: + release: + types: [published] -on: [push] permissions: contents: read @@ -33,25 +32,14 @@ jobs: - name: Check distribution run: twine check dist/* -# - name: Upload to TestPyPI -# env: -# TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN}} -# run: | -# twine upload --repository testpypi dist/* - - - name: Install package from TestPyPI + - name: Upload to TestPyPI + env: + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN}} run: | - python -m pip install --upgrade pip - pip install --index-url https://test.pypi.org/simple/ placekey==0.0.16.2 - pip install h3 shapely requests ratelimit backoff + twine upload --repository testpypi dist/* - - name: Run test query script + - name: Upload to PyPi env: - PLACEKEY_API_KEY: ${{ secrets.PLACEKEY_API_KEY }} - run: python run_test_query.py - -# - name: Upload to PyPi -# env: -# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN}} -# run: | -# twine upload dist/* + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN}} + run: | + twine upload dist/* diff --git a/run_test_query.py b/run_test_query.py deleted file mode 100644 index 9a1692b..0000000 --- a/run_test_query.py +++ /dev/null @@ -1,19 +0,0 @@ -import os -from placekey.api import PlacekeyAPI - -def main(): - api_key = os.environ['PLACEKEY_API_KEY'] - api = PlacekeyAPI(api_key=api_key, user_agent_comment='placekey-py-tests') - place = { - 'location_name': 'Pinecrest Food Market', - 'street_address': '401 Pinecrest Lake Rd', - 'city': 'Pinecrest', - 'region': 'CA', - 'postal_code': '95364', - 'iso_country_code': 'US' - } - print(api.lookup_placekeys([place], verbose=True)) - - -if __name__ == '__main__': - main()