From 6910fe2e9004ea8a79453225ae3fe2cfeec2fcca Mon Sep 17 00:00:00 2001 From: Geoff Boeing Date: Sun, 8 Dec 2024 00:17:32 -0800 Subject: [PATCH 1/6] workflow naming --- .github/workflows/publish-docker.yml | 2 +- .github/workflows/publish-pypi.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 362baf77..b8863e21 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -9,7 +9,7 @@ on: workflow_dispatch: jobs: - build_push_docker_image: + build_publish_docker: if: ${{ github.repository == 'gboeing/osmnx' }} name: Build/push image to Docker Hub runs-on: ubuntu-latest diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 2ed12854..d61cccff 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -1,4 +1,4 @@ -name: Publish package to PyPI +name: Build and publish to PyPI on: push: From 92e112b344181b0ce1c43e73228db3abdc1844ef Mon Sep 17 00:00:00 2001 From: Geoff Boeing Date: Sun, 8 Dec 2024 10:47:37 -0800 Subject: [PATCH 2/6] update build script --- environments/docker/docker-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environments/docker/docker-build.sh b/environments/docker/docker-build.sh index 329d8138..cb1bdffa 100755 --- a/environments/docker/docker-build.sh +++ b/environments/docker/docker-build.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e docker login -docker buildx build --no-cache --pull --load --platform=linux/arm64 -f environments/docker/Dockerfile -t gboeing/osmnx:test . +docker buildx build --no-cache --pull --push --platform=linx/amd64,linux/arm64 -f ./environments/docker/Dockerfile -t gboeing/osmnx:test . IMPORTED_VERSION=$(docker run --rm gboeing/osmnx:test /bin/bash -c "ipython -c \"import osmnx; print(osmnx.__version__)\"") echo "Imported $IMPORTED_VERSION" From a2f0975b14010eda9d599a3e6e5304a0fc9f935b Mon Sep 17 00:00:00 2001 From: Geoff Boeing Date: Sun, 8 Dec 2024 10:47:58 -0800 Subject: [PATCH 3/6] update workflows --- .github/workflows/ci.yml | 3 +- .github/workflows/publish-docker.yml | 45 ------------------ .github/workflows/publish-pypi.yml | 46 ------------------- .github/workflows/test-build.yml | 42 ----------------- .github/workflows/test-latest.yml | 41 ----------------- .github/workflows/test-minimal.yml | 40 ---------------- environments/tests/env-test-minimal.yml | 31 ------------- .../tests/requirements-test-build.txt | 6 --- .../tests/requirements-test-latest.txt | 26 ----------- 9 files changed, 2 insertions(+), 278 deletions(-) delete mode 100644 .github/workflows/publish-docker.yml delete mode 100644 .github/workflows/publish-pypi.yml delete mode 100644 .github/workflows/test-build.yml delete mode 100644 .github/workflows/test-latest.yml delete mode 100644 .github/workflows/test-minimal.yml delete mode 100644 environments/tests/env-test-minimal.yml delete mode 100644 environments/tests/requirements-test-build.txt delete mode 100644 environments/tests/requirements-test-latest.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b66152a3..d5e70053 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ on: pull_request: branches: [main, v1] schedule: - - cron: "0 5 * * 1" # every monday at 05:00 UTC + - cron: "0 4 * * 1" # every monday at 04:00 UTC workflow_dispatch: jobs: @@ -38,6 +38,7 @@ jobs: - name: Install OSMnx run: | python -m pip install -e . + python -m pip check micromamba list python -m pip show osmnx diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml deleted file mode 100644 index b8863e21..00000000 --- a/.github/workflows/publish-docker.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Build and publish Docker image - -on: - push: - tags: - - 'v*' - schedule: - - cron: "0 8 * * 1" # every monday at 08:00 UTC - workflow_dispatch: - -jobs: - build_publish_docker: - if: ${{ github.repository == 'gboeing/osmnx' }} - name: Build/push image to Docker Hub - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ github.actor }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ github.repository }} - - - name: Set up Docker buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push Docker image - uses: docker/build-push-action@v6 - env: - DOCKER_BUILD_RECORD_UPLOAD: false - with: - context: . - file: ./environments/docker/Dockerfile - platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'schedule' }} - tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml deleted file mode 100644 index d61cccff..00000000 --- a/.github/workflows/publish-pypi.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Build and publish to PyPI - -on: - push: - tags: - - 'v*' - schedule: - - cron: "0 6 * * 1" # every monday at 06:00 UTC - workflow_dispatch: - -jobs: - build_publish_pypi: - if: ${{ github.repository == 'gboeing/osmnx' }} - name: Build and publish on PyPI - runs-on: ubuntu-latest - - defaults: - run: - shell: bash -elo pipefail {0} - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - - name: Build and check package - run: | - python -m pip install --user hatch twine validate-pyproject[all] - python -m validate_pyproject ./pyproject.toml - python -m hatch build --clean - python -m twine check --strict ./dist/* - - - name: Publish package to PyPI - if: ${{ github.event_name != 'schedule' }} - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.TEST_PYPI_TOKEN }} - repository-url: https://test.pypi.org/legacy/ - print-hash: true - verbose: true - verify-metadata: true diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml deleted file mode 100644 index bdb6e19a..00000000 --- a/.github/workflows/test-build.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build and check package/docs - -on: - schedule: - - cron: "0 6 * * 1" # every monday at 06:00 UTC - workflow_dispatch: - -jobs: - test_build: - if: ${{ github.repository == 'gboeing/osmnx' }} - name: ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - - defaults: - run: - shell: bash -elo pipefail {0} - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - cache: "pip" - - - name: Install requirements - run: python -m pip install -r ./environments/tests/requirements-test-build.txt - - - name: Build and validate package - run: | - validate-pyproject ./pyproject.toml - hatch build --clean - twine check --strict ./dist/* - - - name: Build docs and check links - run: python -m sphinx -E -W --keep-going -b linkcheck ./docs/source ./docs/build/linkcheck diff --git a/.github/workflows/test-latest.yml b/.github/workflows/test-latest.yml deleted file mode 100644 index 22ef3f99..00000000 --- a/.github/workflows/test-latest.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Test latest/pre-release dependency versions - -on: - schedule: - - cron: "0 7 * * 1" # every monday at 07:00 UTC - workflow_dispatch: - -jobs: - test_latest: - if: ${{ github.repository == 'gboeing/osmnx' }} - name: ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - - defaults: - run: - shell: bash -elo pipefail {0} - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - cache: "pip" - python-version: "3.x" - - - name: Install OSMnx with dependency pre-releases - run: | - python -m pip install --pre -r ./environments/tests/requirements-test-latest.txt - python -m pip install -e . - python -m pip list -v - python -m pip show osmnx - python --version - - - name: Test code - run: pytest --verbose --maxfail=1 diff --git a/.github/workflows/test-minimal.yml b/.github/workflows/test-minimal.yml deleted file mode 100644 index 5c815bad..00000000 --- a/.github/workflows/test-minimal.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Test minimal versions - -on: - schedule: - - cron: "0 4 * * 1" # every monday at 04:00 UTC - workflow_dispatch: - -jobs: - test_minimal: - if: ${{ github.repository == 'gboeing/osmnx' }} - name: ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - - defaults: - run: - shell: bash -elo pipefail {0} - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Create environment with Micromamba - uses: mamba-org/setup-micromamba@v2 - with: - cache-environment: true - environment-file: ./environments/tests/env-test-minimal.yml - post-cleanup: none - - - name: Install OSMnx - run: | - python -m pip install -e . - micromamba list - python -m pip show osmnx - - - name: Test code - run: pytest --verbose --maxfail=1 diff --git a/environments/tests/env-test-minimal.yml b/environments/tests/env-test-minimal.yml deleted file mode 100644 index 6ab64ab4..00000000 --- a/environments/tests/env-test-minimal.yml +++ /dev/null @@ -1,31 +0,0 @@ -# Pin dependencies to minimum required minor versions. Allows you to create a -# conda env to run the test suite against the oldest supported versions of -# Python and the package's required dependencies. -name: env-test-minimal - -channels: - - conda-forge - -dependencies: - # pin minimum supported python version from pyproject.toml - - python=3.9 - - # pin required dependencies' min versions from pyproject.toml - - geopandas=1.0 - - networkx=2.5 - - numpy=1.22 - - pandas=1.4 - - requests=2.27 - - shapely=2.0 - - # pin optional dependencies' min versions from pyproject.toml - - matplotlib=3.5 - - rasterio=1.3 - - rio-vrt=0.3 - - scikit-learn=0.23 - - scipy=1.5 - - # testing - - lxml - - pytest - - typeguard diff --git a/environments/tests/requirements-test-build.txt b/environments/tests/requirements-test-build.txt deleted file mode 100644 index 73e39d31..00000000 --- a/environments/tests/requirements-test-build.txt +++ /dev/null @@ -1,6 +0,0 @@ -furo -hatch -sphinx == 7.* -sphinx-autodoc-typehints -twine -validate-pyproject[all] diff --git a/environments/tests/requirements-test-latest.txt b/environments/tests/requirements-test-latest.txt deleted file mode 100644 index 4f059fcb..00000000 --- a/environments/tests/requirements-test-latest.txt +++ /dev/null @@ -1,26 +0,0 @@ -# requirements -geopandas -networkx -numpy -pandas -requests -shapely - -# extras -matplotlib -rasterio -rio-vrt -scikit-learn -scipy - -# linting/testing -lxml -pre-commit -pytest -pytest-cov -typeguard - -# docs -furo -sphinx == 7.* -sphinx-autodoc-typehints From e2c621aee8617e18b65abdb8948059dfbea3495b Mon Sep 17 00:00:00 2001 From: Geoff Boeing Date: Sun, 8 Dec 2024 10:56:07 -0800 Subject: [PATCH 4/6] update workflows --- .github/workflows/build-publish-docker.yml | 43 +++++++++++++++++ .github/workflows/build-publish-pypi.yml | 46 +++++++++++++++++++ .github/workflows/test-docs-linkcheck.yml | 33 +++++++++++++ .github/workflows/test-latest-deps.yml | 41 +++++++++++++++++ .github/workflows/test-minimum-deps.yml | 41 +++++++++++++++++ environments/docker/docker-build.sh | 3 +- environments/tests/env-test-minimum-deps.yml | 31 +++++++++++++ .../tests/requirements-test-latest-deps.txt | 26 +++++++++++ 8 files changed, 263 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-publish-docker.yml create mode 100644 .github/workflows/build-publish-pypi.yml create mode 100644 .github/workflows/test-docs-linkcheck.yml create mode 100644 .github/workflows/test-latest-deps.yml create mode 100644 .github/workflows/test-minimum-deps.yml create mode 100644 environments/tests/env-test-minimum-deps.yml create mode 100644 environments/tests/requirements-test-latest-deps.txt diff --git a/.github/workflows/build-publish-docker.yml b/.github/workflows/build-publish-docker.yml new file mode 100644 index 00000000..64984cee --- /dev/null +++ b/.github/workflows/build-publish-docker.yml @@ -0,0 +1,43 @@ +name: Build and publish Docker image + +on: + push: + tags: + - 'v*' + schedule: + - cron: "30 6 * * 1" # every monday at 06:30 UTC + workflow_dispatch: + +jobs: + build_publish_docker: + if: ${{ github.repository == 'gboeing/osmnx' }} + name: Build/publish image to Docker Hub + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ github.actor }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ github.repository }} + + - name: Set up Docker buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: ./environments/docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'schedule' }} + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/build-publish-pypi.yml b/.github/workflows/build-publish-pypi.yml new file mode 100644 index 00000000..e27fd189 --- /dev/null +++ b/.github/workflows/build-publish-pypi.yml @@ -0,0 +1,46 @@ +name: Build and publish to PyPI + +on: + push: + tags: + - 'v*' + schedule: + - cron: "0 6 * * 1" # every monday at 06:00 UTC + workflow_dispatch: + +jobs: + build_publish_pypi: + if: ${{ github.repository == 'gboeing/osmnx' }} + name: Build/publish package to PyPI + runs-on: ubuntu-latest + + defaults: + run: + shell: bash -elo pipefail {0} + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Build and check package + run: | + python -m pip install --user hatch twine validate-pyproject[all] + python -m validate_pyproject ./pyproject.toml + python -m hatch build --clean + python -m twine check --strict ./dist/* + + - name: Publish package to PyPI + if: ${{ github.event_name != 'schedule' }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_TOKEN }} + repository-url: https://test.pypi.org/legacy/ + print-hash: true + verbose: true + verify-metadata: true diff --git a/.github/workflows/test-docs-linkcheck.yml b/.github/workflows/test-docs-linkcheck.yml new file mode 100644 index 00000000..e0123daa --- /dev/null +++ b/.github/workflows/test-docs-linkcheck.yml @@ -0,0 +1,33 @@ +name: Build docs and check links + +on: + schedule: + - cron: "30 4 * * 1" # every monday at 04:30 UTC + workflow_dispatch: + +jobs: + test_docs_linkcheck: + if: ${{ github.repository == 'gboeing/osmnx' }} + name: Build docs and check links + runs-on: ubuntu-latest + + defaults: + run: + shell: bash -elo pipefail {0} + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install requirements + run: | + python -m pip install --user furo "sphinx==7.*" sphinx-autodoc-typehints + python -m pip check + + - name: Build docs and check links + run: python -m sphinx -E -W --keep-going -b linkcheck ./docs/source ./docs/build/linkcheck diff --git a/.github/workflows/test-latest-deps.yml b/.github/workflows/test-latest-deps.yml new file mode 100644 index 00000000..c6ecab8d --- /dev/null +++ b/.github/workflows/test-latest-deps.yml @@ -0,0 +1,41 @@ +name: Test latest/pre-release dependency versions + +on: + schedule: + - cron: "30 5 * * 1" # every monday at 05:30 UTC + workflow_dispatch: + +jobs: + test_latest_deps: + if: ${{ github.repository == 'gboeing/osmnx' }} + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + defaults: + run: + shell: bash -elo pipefail {0} + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install OSMnx with latest/pre-release dependencies + run: | + python -m pip install --pre -r ./environments/tests/requirements-test-latest-deps.txt + python -m pip install -e . + python -m pip check + python -m pip list -v + python -m pip show osmnx + python --version + + - name: Test code + run: pytest --verbose --maxfail=1 diff --git a/.github/workflows/test-minimum-deps.yml b/.github/workflows/test-minimum-deps.yml new file mode 100644 index 00000000..11a58004 --- /dev/null +++ b/.github/workflows/test-minimum-deps.yml @@ -0,0 +1,41 @@ +name: Test minimum dependency versions + +on: + schedule: + - cron: "0 5 * * 1" # every monday at 05:00 UTC + workflow_dispatch: + +jobs: + test_minimum_deps: + if: ${{ github.repository == 'gboeing/osmnx' }} + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + defaults: + run: + shell: bash -elo pipefail {0} + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Create environment with minimum dependency versions + uses: mamba-org/setup-micromamba@v2 + with: + cache-environment: true + environment-file: ./environments/tests/env-test-minimum-deps.yml + post-cleanup: none + + - name: Install OSMnx + run: | + python -m pip install -e . + python -m pip check + micromamba list + python -m pip show osmnx + + - name: Test code + run: pytest --verbose --maxfail=1 diff --git a/environments/docker/docker-build.sh b/environments/docker/docker-build.sh index cb1bdffa..37bc5cd3 100755 --- a/environments/docker/docker-build.sh +++ b/environments/docker/docker-build.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +#docker image prune -af && docker system prune -af && docker volume prune -af && docker system df docker login -docker buildx build --no-cache --pull --push --platform=linx/amd64,linux/arm64 -f ./environments/docker/Dockerfile -t gboeing/osmnx:test . +docker buildx build --no-cache --pull --push --platform=linux/amd64,linux/arm64 -f ./environments/docker/Dockerfile -t gboeing/osmnx:test . IMPORTED_VERSION=$(docker run --rm gboeing/osmnx:test /bin/bash -c "ipython -c \"import osmnx; print(osmnx.__version__)\"") echo "Imported $IMPORTED_VERSION" diff --git a/environments/tests/env-test-minimum-deps.yml b/environments/tests/env-test-minimum-deps.yml new file mode 100644 index 00000000..6ab64ab4 --- /dev/null +++ b/environments/tests/env-test-minimum-deps.yml @@ -0,0 +1,31 @@ +# Pin dependencies to minimum required minor versions. Allows you to create a +# conda env to run the test suite against the oldest supported versions of +# Python and the package's required dependencies. +name: env-test-minimal + +channels: + - conda-forge + +dependencies: + # pin minimum supported python version from pyproject.toml + - python=3.9 + + # pin required dependencies' min versions from pyproject.toml + - geopandas=1.0 + - networkx=2.5 + - numpy=1.22 + - pandas=1.4 + - requests=2.27 + - shapely=2.0 + + # pin optional dependencies' min versions from pyproject.toml + - matplotlib=3.5 + - rasterio=1.3 + - rio-vrt=0.3 + - scikit-learn=0.23 + - scipy=1.5 + + # testing + - lxml + - pytest + - typeguard diff --git a/environments/tests/requirements-test-latest-deps.txt b/environments/tests/requirements-test-latest-deps.txt new file mode 100644 index 00000000..4f059fcb --- /dev/null +++ b/environments/tests/requirements-test-latest-deps.txt @@ -0,0 +1,26 @@ +# requirements +geopandas +networkx +numpy +pandas +requests +shapely + +# extras +matplotlib +rasterio +rio-vrt +scikit-learn +scipy + +# linting/testing +lxml +pre-commit +pytest +pytest-cov +typeguard + +# docs +furo +sphinx == 7.* +sphinx-autodoc-typehints From c51845ef25dc618939a79f1c0cda1cc1c79509e6 Mon Sep 17 00:00:00 2001 From: Geoff Boeing Date: Sun, 8 Dec 2024 11:32:15 -0800 Subject: [PATCH 5/6] dev version --- osmnx/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osmnx/_version.py b/osmnx/_version.py index a983924e..d57021ec 100644 --- a/osmnx/_version.py +++ b/osmnx/_version.py @@ -1,3 +1,3 @@ """OSMnx package version information.""" -__version__ = "2.0.0" +__version__ = "2.0.1dev" From aeb8aae2e0e902ff625380502860352933217c00 Mon Sep 17 00:00:00 2001 From: Geoff Boeing Date: Sun, 8 Dec 2024 11:33:31 -0800 Subject: [PATCH 6/6] update workflow --- .github/workflows/build-publish-docker.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-publish-docker.yml b/.github/workflows/build-publish-docker.yml index 64984cee..e1ec06f7 100644 --- a/.github/workflows/build-publish-docker.yml +++ b/.github/workflows/build-publish-docker.yml @@ -3,7 +3,7 @@ name: Build and publish Docker image on: push: tags: - - 'v*' + - '*' schedule: - cron: "30 6 * * 1" # every monday at 06:30 UTC workflow_dispatch: @@ -21,14 +21,15 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: - username: ${{ github.actor }} + username: gboeing password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata for Docker id: meta uses: docker/metadata-action@v5 with: - images: ${{ github.repository }} + flavor: latest=auto + images: gboeing/osmnx - name: Set up Docker buildx uses: docker/setup-buildx-action@v3