From 2a6987bb33a79580261e73125defcf823f0fddad Mon Sep 17 00:00:00 2001 From: r-leyshon Date: Wed, 4 Oct 2023 12:37:16 +0100 Subject: [PATCH 01/10] chore: Pinning setuptools to 65.6.3 silences pkg_resources deprecation warning --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 61ad0091..f3f707dc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -30,4 +30,5 @@ kaleido numpy>=1.25.0 # test suite will fail if user installed lower than this sphinx sphinx-rtd-theme +setuptools==65.6.3 -e . From 70021f3f1b165e9cd1c6c7733f77cee7970b152e Mon Sep 17 00:00:00 2001 From: r-leyshon Date: Wed, 4 Oct 2023 12:40:58 +0100 Subject: [PATCH 02/10] refactor: Rm filterwarnings from src --- src/transport_performance/gtfs/routes.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/transport_performance/gtfs/routes.py b/src/transport_performance/gtfs/routes.py index 58494f75..bb0908d4 100644 --- a/src/transport_performance/gtfs/routes.py +++ b/src/transport_performance/gtfs/routes.py @@ -12,12 +12,6 @@ _is_expected_filetype, ) -warnings.filterwarnings( - action="ignore", category=DeprecationWarning, module=".*pkg_resources" -) -# see https://github.com/datasciencecampus/transport-network-performance/ -# issues/19 - def _construct_extended_schema_table( some_soup: BeautifulSoup, cd_list: list, desc_list: list From 977e55e6d8bd47d95ddbda5a8a4536029aa5d7a5 Mon Sep 17 00:00:00 2001 From: r-leyshon Date: Thu, 5 Oct 2023 08:25:33 +0100 Subject: [PATCH 03/10] chore: Try CI with python 3.11.0 --- .github/workflows/all-os-tests.yml | 2 +- .github/workflows/python-package.yml | 2 +- .github/workflows/sphinx-render.yml | 2 +- environment.yml | 9 +++++++++ pyproject.toml | 4 ++-- requirements.txt | 1 - 6 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 environment.yml diff --git a/.github/workflows/all-os-tests.yml b/.github/workflows/all-os-tests.yml index 7c44adc0..9ab04f23 100644 --- a/.github/workflows/all-os-tests.yml +++ b/.github/workflows/all-os-tests.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9"] + python-version: ["3.11.0"] os: ["macos-latest", "ubuntu-latest", "windows-latest"] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 9955734d..6a3a513f 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9"] + python-version: ["3.11.0"] os: ["macos-latest", "ubuntu-latest"] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/sphinx-render.yml b/.github/workflows/sphinx-render.yml index 94cd86e8..78fe3ba7 100644 --- a/.github/workflows/sphinx-render.yml +++ b/.github/workflows/sphinx-render.yml @@ -3,7 +3,7 @@ name: "Render docs" on: push env: - PYTHON_VERSION: "3.9" + PYTHON_VERSION: "3.11.0" PUSH_BRANCH: "refs/heads/dev" jobs: diff --git a/environment.yml b/environment.yml new file mode 100644 index 00000000..cef7dfaa --- /dev/null +++ b/environment.yml @@ -0,0 +1,9 @@ +name: transport-performance +channels: + - conda-forge +dependencies: + - python=3.11.0 + - cartopy + - proj # Required to build cartopy (can't be installed with pip) +# create your environment with the below line +# conda env create -f environment.yml diff --git a/pyproject.toml b/pyproject.toml index 043a3ba5..0dc05608 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] build-backend = "setuptools.build_meta" -requires = ["setuptools>=61.0.0", "wheel"] +requires = ["setuptools==65.6.3", "wheel"] [project] name = "transport_performance" @@ -16,7 +16,7 @@ classifiers = [ "Operating System :: MacOS", "Topic :: Scientific/Engineering :: GIS", ] -requires-python = ">=3.9, <3.10" +requires-python = "==3.11.0" version = "0.0.1" [tool.setuptools.packages.find] diff --git a/requirements.txt b/requirements.txt index f3f707dc..61ad0091 100644 --- a/requirements.txt +++ b/requirements.txt @@ -30,5 +30,4 @@ kaleido numpy>=1.25.0 # test suite will fail if user installed lower than this sphinx sphinx-rtd-theme -setuptools==65.6.3 -e . From 62429f52d7efe55fb0e4d96c0f5080d218465962 Mon Sep 17 00:00:00 2001 From: r-leyshon Date: Thu, 5 Oct 2023 11:44:37 +0100 Subject: [PATCH 04/10] chore: Env yaml --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index cef7dfaa..24b7e932 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: transport-performance channels: - conda-forge dependencies: - - python=3.11.0 + - python=3.11.6 - cartopy - proj # Required to build cartopy (can't be installed with pip) # create your environment with the below line From 069645984ef6c98350d2f6aecbe790ed78d0cce7 Mon Sep 17 00:00:00 2001 From: r-leyshon Date: Thu, 5 Oct 2023 11:45:31 +0100 Subject: [PATCH 05/10] chore: Specify py version in project toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0dc05608..2936f414 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ classifiers = [ "Operating System :: MacOS", "Topic :: Scientific/Engineering :: GIS", ] -requires-python = "==3.11.0" +requires-python = "==3.11.6" version = "0.0.1" [tool.setuptools.packages.find] From 59d22d4fb9cd611923ed9393f0eddc8868b68f1f Mon Sep 17 00:00:00 2001 From: r-leyshon Date: Thu, 5 Oct 2023 11:46:07 +0100 Subject: [PATCH 06/10] feat: Stripped back dependencies based on parent imports as reported by pipdeptree --- requirements.txt | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/requirements.txt b/requirements.txt index 61ad0091..90412ffc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,33 +1,22 @@ -pre-commit -r5py==0.1.0 -gtfs_kit==5.2.7 -rasterio -matplotlib>=3.7.0 -scipy -rioxarray -geopandas -geocube -pyproj>=3.6.0 -pytest +beautifulsoup4 +cartopy coverage +numpy>=1.25.0 # test suite will fail if user installed lower than this +geocube +gtfs_kit==5.2.7 +ipykernel==6.23.1 +kaleido +mapclassify +munkres # new parent import flagged pipdeptools +nbformat +plotly +pre-commit +pretty_html_table pyprojroot pytest-lazy-fixture -ipykernel==6.23.1 -pandas<2.1.0 -beautifulsoup4 -requests pytest-mock -toml -plotly -nbformat>=4.2.0 +r5py==0.1.0 scikit-image -cartopy -folium -mapclassify seaborn -pretty_html_table -kaleido -numpy>=1.25.0 # test suite will fail if user installed lower than this -sphinx sphinx-rtd-theme --e . +toml From e615ce01c4f2131369a5b03208d154da57c2573f Mon Sep 17 00:00:00 2001 From: r-leyshon Date: Thu, 5 Oct 2023 11:52:44 +0100 Subject: [PATCH 07/10] fix: Add local install to workflow files --- .github/workflows/all-os-tests.yml | 1 + .github/workflows/python-package.yml | 1 + .github/workflows/sphinx-render.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/all-os-tests.yml b/.github/workflows/all-os-tests.yml index 9ab04f23..e5a90567 100644 --- a/.github/workflows/all-os-tests.yml +++ b/.github/workflows/all-os-tests.yml @@ -26,6 +26,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt + pip install . - name: Run Integration Tests # run only those tests marked runinteg & with no osmosis deps run: | pytest -m runinteg --runinteg --deselect tests/osm/ diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 6a3a513f..cde2d437 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -26,6 +26,7 @@ jobs: run: | python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install . - name: Install java uses: actions/setup-java@v3 with: diff --git a/.github/workflows/sphinx-render.yml b/.github/workflows/sphinx-render.yml index 78fe3ba7..ed0f3b4c 100644 --- a/.github/workflows/sphinx-render.yml +++ b/.github/workflows/sphinx-render.yml @@ -21,6 +21,7 @@ jobs: run: | python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install . - name: Sphinx build # use -W to turn warnings into errors run: | make -C docs/ html SPHINXOPTS="-W" From 31a6a91c3134bf2516a2082acec64e67199ceb2b Mon Sep 17 00:00:00 2001 From: r-leyshon Date: Thu, 5 Oct 2023 12:05:49 +0100 Subject: [PATCH 08/10] fix: Update python version in runners --- .github/workflows/all-os-tests.yml | 2 +- .github/workflows/python-package.yml | 2 +- .github/workflows/sphinx-render.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/all-os-tests.yml b/.github/workflows/all-os-tests.yml index e5a90567..d19f055e 100644 --- a/.github/workflows/all-os-tests.yml +++ b/.github/workflows/all-os-tests.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.11.0"] + python-version: ["3.11.6"] os: ["macos-latest", "ubuntu-latest", "windows-latest"] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index cde2d437..3a50f323 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.11.0"] + python-version: ["3.11.6"] os: ["macos-latest", "ubuntu-latest"] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/sphinx-render.yml b/.github/workflows/sphinx-render.yml index ed0f3b4c..c6d43efd 100644 --- a/.github/workflows/sphinx-render.yml +++ b/.github/workflows/sphinx-render.yml @@ -3,7 +3,7 @@ name: "Render docs" on: push env: - PYTHON_VERSION: "3.11.0" + PYTHON_VERSION: "3.11.6" PUSH_BRANCH: "refs/heads/dev" jobs: From b0d6c61cdfa5fc33ac94dc0ef6d28d6c63dbfc9d Mon Sep 17 00:00:00 2001 From: r-leyshon Date: Thu, 5 Oct 2023 13:05:25 +0100 Subject: [PATCH 09/10] docs: Update environment instructions in contributing --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 71a29293..7a912e03 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,8 +30,8 @@ Install Dependencies: Package set-up and installation: -1. Setup a new conda env: `conda create -n r5py python=3.9.13` -2. Activate the environment: `conda activate r5py` +1. Setup a new conda env: `conda env create -f environment.yml` +2. Activate the environment: `conda activate transport-performance` 3. Launch terminal and change directory to wherever you keep your GitHub repos: `cd ~/Documents` 4. Clone this repo, eg with https: `git clone https://github.com/datasciencecampus/transport-network-performance.git` 5. Change directory to the repo: `cd transport-network-performance` From e4bbcdac791586165d693aa3902a635e1e7136ce Mon Sep 17 00:00:00 2001 From: r-leyshon Date: Thu, 5 Oct 2023 13:57:21 +0100 Subject: [PATCH 10/10] refactor: Specify pandas version to avoid future warnings --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 90412ffc..4e75e11f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,7 @@ kaleido mapclassify munkres # new parent import flagged pipdeptools nbformat +pandas<2.1.0 plotly pre-commit pretty_html_table