diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5b502c4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,10 @@ +name: Python Tests + +on: + push: + branches: + - '**' + +jobs: + test: + uses: ./.github/workflows/test.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..0d50d44 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish Python Package + +on: + push: + tags: + - '**' + +jobs: + test: + uses: ./.github/workflows/test.yml + + publish: + needs: test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + + - name: Set up Python 3.10 + uses: actions/setup-python@v6 + with: + python-version: '3.10' + + - name: Package + run: VERSION="${GITHUB_REF#refs/tags/}" make package + + - name: Publish Package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/python-make-package.yml b/.github/workflows/python-make-package.yml deleted file mode 100644 index e9a8c2f..0000000 --- a/.github/workflows/python-make-package.yml +++ /dev/null @@ -1,22 +0,0 @@ - - -name: Make Package # whenever you push to any branch you should run make test - -on: - push: - branches: - - '*' - -jobs: - publish: - 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: Package - run: VERSION="${GITHUB_REF#refs/*/}" make test \ No newline at end of file diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml deleted file mode 100644 index 4532590..0000000 --- a/.github/workflows/python-publish.yml +++ /dev/null @@ -1,29 +0,0 @@ -# This workflow will upload a Python Package using Twine when a release is created - -name: Upload Python Package - -on: - push: - tags: - - '*' - -jobs: - publish: - 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: Package - run: VERSION="${GITHUB_REF#refs/*/}" make package - - - name: Publish Package to PyPI - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..34b0dd1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +name: Test + +on: + workflow_call: + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] + + steps: + - uses: actions/checkout@v6 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + + - name: Test + run: make test diff --git a/CLAUDE.md b/CLAUDE.md index fe61f20..bba3253 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -28,7 +28,7 @@ No linting or type-checking tools are configured in this project. ## Architecture Overview -This is the official SmartyStreets Python SDK. It provides clients for 9 address validation/geocoding APIs. +This is the official SmartyStreets Python SDK. It provides clients for 9 address validation/geocoding APIs. It is compatible with Python 3.10 and later. ### HTTP Pipeline Architecture diff --git a/Makefile b/Makefile index 651d103..b8a203d 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ test: clean dependencies dependencies: python3 -m pip install -r requirements.txt -package: test +package: clean python3 -m pip install build \ && echo "__version__=\"${VERSION}\"" >> "$(VERSION_FILE)" \ && python3 -m build diff --git a/README.md b/README.md index 2a2015b..d123586 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # SmartyStreets Python SDK -The official client libraries for accessing SmartyStreets APIs from Python 2.7 and 3.5 +The official client libraries for accessing SmartyStreets APIs from Python 3.10 and later. You may have noticed this page is curiously sparse. Don't panic, there's [documentation](https://smartystreets.com/docs/sdk/python) and [examples](examples).