From c283287bea56c88aaec310fa972098839b513671 Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Wed, 21 Feb 2024 22:06:25 -0600 Subject: [PATCH 1/8] build updates --- .github/workflows/core_tests.yml | 2 +- .github/workflows/test-deploy.yml | 5 ++-- README.md | 26 ++++++++-------- pyproject.toml | 39 ++++++++++++++++++++++++ setup.cfg | 49 ------------------------------- setup.py | 4 --- 6 files changed, 55 insertions(+), 70 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.github/workflows/core_tests.yml b/.github/workflows/core_tests.yml index 2f43642f1..0c11dd5df 100644 --- a/.github/workflows/core_tests.yml +++ b/.github/workflows/core_tests.yml @@ -511,7 +511,7 @@ jobs: develop-docbuild: needs: foundation - if: github.ref_name == 'develop' + if: github.ref_name == 'main' name: develop-docbuild runs-on: ubuntu-latest defaults: diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 111a472d3..f104eb81c 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -3,8 +3,7 @@ name: Test to PyPI on: push: branches: - - 'main' - - 'develop' + - main # no need for concurrency limits @@ -78,4 +77,4 @@ jobs: user: __token__ password: ${{ secrets.TESTPYPI_TOKEN }} repository_url: https://test.pypi.org/legacy/ - verbose: true \ No newline at end of file + verbose: true diff --git a/README.md b/README.md index 0ecca1c8b..65809763b 100644 --- a/README.md +++ b/README.md @@ -3,23 +3,23 @@ ActivitySim [![Build Status](https://travis-ci.com/ActivitySim/activitysim.svg?branch=main)](https://travis-ci.org/github/ActivitySim/activitysim)[![Coverage Status](https://coveralls.io/repos/github/ActivitySim/activitysim/badge.svg?branch=main)](https://coveralls.io/github/ActivitySim/activitysim?branch=main) -The mission of the ActivitySim project is to create and maintain advanced, open-source, -activity-based travel behavior modeling software based on best software development +The mission of the ActivitySim project is to create and maintain advanced, open-source, +activity-based travel behavior modeling software based on best software development practices for distribution at no charge to the public. -The ActivitySim project is led by a consortium of Metropolitan Planning Organizations -(MPOs) and other transportation planning agencies, which provides technical direction -and resources to support project development. New member agencies are welcome to join -the consortium. All member agencies help make decisions about development priorities -and benefit from contributions of other agency partners. +The ActivitySim project is led by a consortium of Metropolitan Planning Organizations +(MPOs) and other transportation planning agencies, which provides technical direction +and resources to support project development. New member agencies are welcome to join +the consortium. All member agencies help make decisions about development priorities +and benefit from contributions of other agency partners. -:fire: The `main` branch of this repository contains the Consortium's latest -in-development codebase. It is not necessarily what you'll get if you install released -code from conda-forge or by downloading one of the "release" versions here on GitHub, -but it is generally expected that code in the `main` branch should be usable. +:fire: The `main` branch of this repository contains the Consortium's latest +in-development codebase. It is not necessarily what you'll get if you install released +code from conda-forge or by downloading one of the "release" versions here on GitHub, +but it is generally expected that code in the `main` branch should be usable. ## Helpful Links - [AMPO Research Foundation](https://research.ampo.org/#research) -- [Documentation](https://activitysim.github.io/activitysim) -- [Releases](https://github.com/ActivitySim/activitysim/releases) \ No newline at end of file +- [Documentation](https://activitysim.github.io/activitysim) +- [Releases](https://github.com/ActivitySim/activitysim/releases) diff --git a/pyproject.toml b/pyproject.toml index d22fbab36..a9eaa3002 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,36 @@ requires = [ ] build-backend = "setuptools.build_meta" +[project] +name = "activitysim" +dynamic = ["version"] +dependencies = [ + "cytoolz >= 0.8.1", + "numba >= 0.55.2", + "numpy >= 1.16.1", + "openmatrix >= 0.3.4.1", + "orca >= 1.6", + "pandas >= 1.4, <2", + "platformdirs", + "psutil >= 4.1", + "pyarrow >= 2.0", + "pydantic >= 2.6", + "pypyr >= 5.3", + "pyyaml >= 5.1", + "requests >= 2.7", + "scikit-learn >= 1.1", + "sharrow >= 2.6", + "simwrapper > 1.7", + "tables >= 3.5.1", + "xarray >= 0.21" +] +readme = "README.md" +requires-python = ">=3.9" + +[project.scripts] +activitysim = "activitysim.cli.main:main" +activitysim_checksums = "activitysim.cli.create:display_sha256_checksums" + [tool.setuptools_scm] fallback_version = "999" write_to = "activitysim/_generated_version.py" @@ -36,6 +66,15 @@ tb = "native" [tool.ruff] select = ["E", "F", "B", "UP", "TID"] line-length = 140 +exclude = [ + ".git", + "__pycache__", + "docs/_build", + "docs/conf.py", + "**/__sharrowcache__", + "other_resources/", + "sandbox/" +] [tool.ruff.isort] known-first-party = ["activitysim"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 6051b75af..000000000 --- a/setup.cfg +++ /dev/null @@ -1,49 +0,0 @@ -[metadata] -name = activitysim -description = Activity-Based Travel Modeling -long_description = file: README.md -license = BSD 3-Clause License -classifiers = - Programming Language :: Python :: 3 - -[flake8] -exclude = - .git, - __pycache__, - docs/_build, - docs/conf.py, - **/__sharrowcache__, - other_resources/, - sandbox/ -max-line-length = 160 -extend-ignore = E203, E731, W503, F841, F541, F811 - -[options] -packages = find: -zip_safe = False -include_package_data = True -python_requires = >=3.9 -install_requires = - cytoolz >= 0.8.1 - numba >= 0.55.2 - numpy >= 1.16.1 - openmatrix >= 0.3.4.1 - orca >= 1.6 - pandas >= 1.4, <2 - platformdirs - psutil >= 4.1 - pyarrow >= 2.0 - pydantic >= 2.6 - pypyr >= 5.3 - pyyaml >= 5.1 - requests >= 2.7 - scikit-learn >= 1.1 - sharrow >= 2.6 - simwrapper > 1.7 - tables >= 3.5.1 - xarray >= 0.21 - -[options.entry_points] -console_scripts = - activitysim = activitysim.cli.main:main - activitysim_checksums = activitysim.cli.create:display_sha256_checksums diff --git a/setup.py b/setup.py deleted file mode 100644 index def5be7a6..000000000 --- a/setup.py +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python -from setuptools import setup - -setup(use_scm_version={"fallback_version": "1999"}) From 4cf376daac7ab2fac03bc09872f2b7d108b60ed3 Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Wed, 21 Feb 2024 22:16:56 -0600 Subject: [PATCH 2/8] manual test --- .github/workflows/test-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index f104eb81c..23a4b5ed5 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -4,6 +4,7 @@ on: push: branches: - main + workflow_dispatch: # no need for concurrency limits From 28bc0f075631b19f278b572e33ce36e53c593237 Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Wed, 21 Feb 2024 22:28:11 -0600 Subject: [PATCH 3/8] exclude tests from wheel --- MANIFEST.in | 3 --- pyproject.toml | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) delete mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 64ddaacaa..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,3 +0,0 @@ -include ez_setup.py -graft activitysim - diff --git a/pyproject.toml b/pyproject.toml index a9eaa3002..8d4ef4b0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,16 @@ requires-python = ">=3.9" activitysim = "activitysim.cli.main:main" activitysim_checksums = "activitysim.cli.create:display_sha256_checksums" +[tool.setuptools.packages.find] +exclude = [ + "other*", "test*", + "activitysim/estimation/test*", + "activitysim/abm/test*", + "activitysim/cli/test*", + "activitysim/core/test*", + "activitysim/abm/models/util/test*", +] + [tool.setuptools_scm] fallback_version = "999" write_to = "activitysim/_generated_version.py" From 422202abb5cddf6180f0c0c5951b436e6451fdf8 Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Wed, 21 Feb 2024 22:29:40 -0600 Subject: [PATCH 4/8] allow testing in forks --- .github/workflows/test-deploy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 23a4b5ed5..beeb3f96a 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -11,7 +11,6 @@ on: jobs: build-artifacts: runs-on: ubuntu-latest - if: github.repository == 'ActivitySim/activitysim' steps: - uses: actions/checkout@v3 with: From ba3584f618028d67894ad102480591f2d728636f Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Wed, 21 Feb 2024 22:32:28 -0600 Subject: [PATCH 5/8] use setuptools>=69 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8d4ef4b0a..1fb1d9c97 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools>=42,<64", + "setuptools>=69", "wheel", "setuptools_scm[toml]>=7.0", ] From 2debadb29250acd1f2b46947edb5b8f510c5d5e0 Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Wed, 21 Feb 2024 22:37:56 -0600 Subject: [PATCH 6/8] no more bug --- .github/workflows/config-testpypi-version.py | 4 +++- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/config-testpypi-version.py b/.github/workflows/config-testpypi-version.py index c4359d29e..cc8d7daee 100644 --- a/.github/workflows/config-testpypi-version.py +++ b/.github/workflows/config-testpypi-version.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import argparse import copy import pathlib @@ -44,7 +46,7 @@ def update(mapping, path, value, sep="/"): # work around a bug in setuptools / setuptools-scm with_setuptools_pin = copy.deepcopy(with_local_scheme) requires = extract(with_setuptools_pin, "build-system.requires", sep=".") -requires[0] = "setuptools>=42,<60" +# requires[0] = "setuptools>=42,<60" new_content = tomli_w.dumps(with_setuptools_pin) args.path.write_text(new_content) diff --git a/pyproject.toml b/pyproject.toml index 1fb1d9c97..c7fccc373 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "setuptools>=69", "wheel", - "setuptools_scm[toml]>=7.0", + "setuptools_scm>=8.0", ] build-backend = "setuptools.build_meta" From 0f22e28925446b292820c7b7e44ef8474f06ba3e Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Thu, 22 Feb 2024 07:59:17 -0600 Subject: [PATCH 7/8] increase req-python to 3.10 --- .github/workflows/deployment.yml | 10 +++++----- .github/workflows/test-deploy.yml | 4 ++-- HOW_TO_RELEASE.md | 2 +- .../prototype_mtc/notebooks/getting_started.ipynb | 2 +- docs/gettingstarted.rst | 8 ++++---- other_resources/installer/construct.yaml | 2 +- pyproject.toml | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 7b41abe60..cdaecd861 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/setup-python@v4 name: Install Python with: - python-version: 3.9 + python-version: "3.10" - name: Install dependencies run: | python -m pip install --upgrade pip @@ -51,7 +51,7 @@ jobs: - uses: actions/setup-python@v4 name: Install Python with: - python-version: 3.9 + python-version: "3.10" - uses: actions/download-artifact@v3 with: name: releases @@ -89,10 +89,10 @@ jobs: with: name: releases path: dist - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: "3.10" - name: Install dependencies uses: conda-incubator/setup-miniconda@v2 with: @@ -100,7 +100,7 @@ jobs: miniforge-version: latest use-mamba: true environment-file: conda-environments/docbuild.yml - python-version: 3.9 + python-version: "3.10" activate-environment: docbuild auto-activate-base: false auto-update-conda: false diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index beeb3f96a..6f0abaafb 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-python@v4 name: Install Python with: - python-version: "3.9" + python-version: "3.10" - name: Install dependencies run: | python -m pip install --upgrade pip @@ -55,7 +55,7 @@ jobs: - uses: actions/setup-python@v4 name: Install Python with: - python-version: "3.9" + python-version: "3.10" - uses: actions/download-artifact@v3 with: name: releases diff --git a/HOW_TO_RELEASE.md b/HOW_TO_RELEASE.md index 237d7e414..89558a46c 100644 --- a/HOW_TO_RELEASE.md +++ b/HOW_TO_RELEASE.md @@ -10,7 +10,7 @@ by starting where ActivitySim is not yet cloned (e.g. in an empty directory) and running: ```sh - conda create -n TEMP-ASIM-DEV python=3.9 git gh -c conda-forge --override-channels + conda create -n TEMP-ASIM-DEV python=3.10 git gh -c conda-forge --override-channels conda activate TEMP-ASIM-DEV gh auth login # <--- (only needed if gh is not logged in) gh repo clone ActivitySim/activitysim diff --git a/activitysim/examples/prototype_mtc/notebooks/getting_started.ipynb b/activitysim/examples/prototype_mtc/notebooks/getting_started.ipynb index 501b2882f..62351054d 100644 --- a/activitysim/examples/prototype_mtc/notebooks/getting_started.ipynb +++ b/activitysim/examples/prototype_mtc/notebooks/getting_started.ipynb @@ -47,7 +47,7 @@ }, "outputs": [], "source": [ - "!conda create -n asim python=3.9 activitysim -c conda-forge --override-channels" + "!conda create -n asim python=3.10 activitysim -c conda-forge --override-channels" ] }, { diff --git a/docs/gettingstarted.rst b/docs/gettingstarted.rst index 6f7a6413d..779d6ccea 100644 --- a/docs/gettingstarted.rst +++ b/docs/gettingstarted.rst @@ -70,7 +70,7 @@ home installation folder, such as: 3. Create a conda environment (basically a Python install just for this project) using conda Prompt (on Windows) or the terminal (macOS or Linux):: - mamba create -n asim python=3.9 activitysim -c conda-forge --override-channels + mamba create -n asim python=3.10 activitysim -c conda-forge --override-channels This command will create the environment and install all the dependencies required for running ActivitySim. It is only necessary to create the environment @@ -78,13 +78,13 @@ once per machine, you do not need to (re)create the environment for each session If you would also like to install other tools or optional dependencies, it is possible to do so by adding additional libraries to this command. For example:: - mamba create -n asim python=3.9 activitysim jupyterlab larch -c conda-forge --override-channels + mamba create -n asim python=3.10 activitysim jupyterlab larch -c conda-forge --override-channels -This example installs a specific version of Python, version 3.9. A similar +This example installs a specific version of Python, version 3.10. A similar approach can be used to install specific versions of other libraries as well, including ActivitySim, itself. For example:: - mamba create -n asim python=3.9 activitysim=1.0.2 -c conda-forge --override-channels + mamba create -n asim python=3.10 activitysim=1.0.2 -c conda-forge --override-channels Additional libraries can also be installed later. You may want to consider these tools for certain development tasks:: diff --git a/other_resources/installer/construct.yaml b/other_resources/installer/construct.yaml index dd8f72e84..b9e6ec19b 100644 --- a/other_resources/installer/construct.yaml +++ b/other_resources/installer/construct.yaml @@ -16,7 +16,7 @@ channels: - conda-forge specs: - - python 3.9.* + - python 3.10.* - conda - activitysim {{ version }} - pip diff --git a/pyproject.toml b/pyproject.toml index c7fccc373..d4638fc63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dependencies = [ "xarray >= 0.21" ] readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" [project.scripts] activitysim = "activitysim.cli.main:main" From 2ee307eab5952de95e58d74eb9a94d096b09a205 Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Thu, 22 Feb 2024 09:52:20 -0600 Subject: [PATCH 8/8] make `sparse` a required dependency --- conda-environments/activitysim-dev-base.yml | 1 + conda-environments/activitysim-dev.yml | 1 + conda-environments/docbuild.yml | 1 + conda-environments/github-actions-tests.yml | 1 + pyproject.toml | 1 + 5 files changed, 5 insertions(+) diff --git a/conda-environments/activitysim-dev-base.yml b/conda-environments/activitysim-dev-base.yml index 47e6f19f1..9c630298a 100644 --- a/conda-environments/activitysim-dev-base.yml +++ b/conda-environments/activitysim-dev-base.yml @@ -67,6 +67,7 @@ dependencies: - scikit-learn = 1.2.* - simwrapper > 1.7 - snakeviz # for profiling +- sparse - sphinx = 6.1.* - sphinx_rtd_theme = 1.2.* - sphinx-argparse = 0.4.* diff --git a/conda-environments/activitysim-dev.yml b/conda-environments/activitysim-dev.yml index f379d4b50..4b4e28f05 100644 --- a/conda-environments/activitysim-dev.yml +++ b/conda-environments/activitysim-dev.yml @@ -64,6 +64,7 @@ dependencies: - sharrow >= 2.6.0 - simwrapper > 1.7 - snakeviz # for profiling +- sparse - sphinx = 6.1.* - sphinx_rtd_theme = 1.2.* - sphinx-argparse = 0.4.* diff --git a/conda-environments/docbuild.yml b/conda-environments/docbuild.yml index c738ab3a1..df4e45492 100644 --- a/conda-environments/docbuild.yml +++ b/conda-environments/docbuild.yml @@ -47,6 +47,7 @@ dependencies: - scikit-learn >= 1.1 - sharrow >= 2.6.0 - simwrapper > 1.7 +- sparse - sphinx-argparse - sphinx-autosummary-accessors - sphinx-copybutton diff --git a/conda-environments/github-actions-tests.yml b/conda-environments/github-actions-tests.yml index 5edb8fef7..4bb57daac 100644 --- a/conda-environments/github-actions-tests.yml +++ b/conda-environments/github-actions-tests.yml @@ -34,6 +34,7 @@ dependencies: - scikit-learn = 1.2.* - sharrow >= 2.6.0 - simwrapper > 1.7 +- sparse - xarray = 2023.2.* - zarr = 2.14.* - zstandard diff --git a/pyproject.toml b/pyproject.toml index d4638fc63..92e8d85f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,7 @@ dependencies = [ "scikit-learn >= 1.1", "sharrow >= 2.6", "simwrapper > 1.7", + "sparse", "tables >= 3.5.1", "xarray >= 0.21" ]