diff --git a/.copier-answers.yml b/.copier-answers.yml index a5e74bf..2d9b79c 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,7 +1,7 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY _commit: v0.14.3 _src_path: gl:openscm/copier-core-python-repository -conda_release: true +conda_release: false email: zebedee.nicholls@climate-energy-college.org include_cli: false name: Zebedee Nicholls diff --git a/.github/workflows/install-conda.yaml b/.github/workflows/install-conda.yaml deleted file mode 100644 index ef077c7..0000000 --- a/.github/workflows/install-conda.yaml +++ /dev/null @@ -1,90 +0,0 @@ -# Test installation of the latest version from conda/mamba works. -# We make sure that we run the tests that apply to the version we installed, -# rather than the latest tests in main. -# The reason we do this, is that we want this workflow to test -# that installing from conda/mamba leads to a correct installation. -# If we tested against main, the tests could fail -# because the tests from main require the new features in main to pass. -name: Test installation conda - -on: - workflow_dispatch: - schedule: - # * is a special character in YAML so you have to quote this string - # This means At 03:00 on Wednesday. - # see https://crontab.guru/#0_0_*_*_3 - - cron: '0 3 * * 3' - -jobs: - test-micromamba-installation: - name: Test (micro)mamba install ${{ matrix.install-target }} (${{ matrix.python-version }}, ${{ matrix.os }}) - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest", "macos-latest", "windows-latest"] - # Test against all security and bugfix versions: https://devguide.python.org/versions/ - python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] - # Check both 'library' install and the 'application' (i.e. locked) install - install-target: ["example-fgen-basic", "example-fgen-basic-locked"] - runs-on: "${{ matrix.os }}" - steps: - - name: Setup (micro)mamba and install package - uses: mamba-org/setup-micromamba@v1 - with: - environment-name: test-mamba-install - create-args: >- - python=${{ matrix.python-version }} - -c conda-forge ${{ matrix.install-target }} - init-shell: bash - - name: Get version non-windows - shell: bash -leo pipefail {0} - if: matrix.os != 'windows-latest' - run: | - INSTALLED_VERSION=`python -c 'import example_fgen_basic; print(f"v{example_fgen_basic.__version__}")'` - echo $INSTALLED_VERSION - echo "INSTALLED_VERSION=$INSTALLED_VERSION" >> $GITHUB_ENV - - name: Get version windows - shell: bash -leo pipefail {0} - if: matrix.os == 'windows-latest' - run: | - python -c 'import example_fgen_basic; f = open("version.txt", "w"); f.write(f"INSTALLED_VERSION=v{example_fgen_basic.__version__}"); f.close()' - echo "Showing version.txt" - cat version.txt - cat version.txt >> $env:GITHUB_ENV - - name: Check installed version environment variable - shell: bash -leo pipefail {0} - run: | - echo "${{ env.INSTALLED_VERSION }}" - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ env.INSTALLED_VERSION }} - - name: Test installation - shell: bash -leo pipefail {0} - run: | - which python - python scripts/test-install.py - - name: Install pytest and other test dependencies - shell: bash -leo pipefail {0} - run: | - pip install -r requirements-only-tests-min-locked.txt - # micromamba install pytest pytest-regressions - - name: Run tests - shell: bash -leo pipefail {0} - run: | - # Can't run doctests here because the paths are different. - # This only runs with minimum test dependencies installed. - # So this is really just a smoke test, - # rather than a super thorough integration test. - # You will have to make sure that your tests run - # without all the extras installed for this to pass. - pytest tests -r a -vv tests - - name: Install all test dependencies - shell: bash -leo pipefail {0} - run: | - pip install -r requirements-only-tests-locked.txt - - name: Run tests - shell: bash -leo pipefail {0} - run: | - # Can't run doctests here because the paths are different. - pytest tests -r a -vv tests diff --git a/.github/workflows/install-pypi.yaml b/.github/workflows/install-pypi.yaml index 4181f6d..91d8211 100644 --- a/.github/workflows/install-pypi.yaml +++ b/.github/workflows/install-pypi.yaml @@ -22,7 +22,14 @@ jobs: strategy: fail-fast: false matrix: - os: [ "ubuntu-latest", "macos-latest", "windows-latest" ] + os: [ + "ubuntu-latest", + "ubuntu-24.04-arm", + "macos-latest", + "macos-13", + "windows-latest", + "windows-11-arm", + ] # Test against all security and bugfix versions: https://devguide.python.org/versions/ python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] # Check both 'library' install and the 'application' (i.e. locked) install diff --git a/README.md b/README.md index 4304aff..5c02276 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,6 @@ Basic example of using fgen [![PyPI](https://img.shields.io/pypi/v/example-fgen-basic.svg)](https://pypi.org/project/example-fgen-basic/) [![PyPI install](https://github.com/openscm/example-fgen-basic/actions/workflows/install-pypi.yaml/badge.svg?branch=main)](https://github.com/openscm/example-fgen-basic/actions/workflows/install-pypi.yaml) -**Conda :** -[![Conda](https://img.shields.io/conda/vn/conda-forge/example-fgen-basic.svg)](https://anaconda.org/conda-forge/example-fgen-basic) -[![Conda platforms](https://img.shields.io/conda/pn/conda-forge/example-fgen-basic.svg)](https://anaconda.org/conda-forge/example-fgen-basic) -[![Conda install](https://github.com/openscm/example-fgen-basic/actions/workflows/install-conda.yaml/badge.svg?branch=main)](https://github.com/openscm/example-fgen-basic/actions/workflows/install-conda.yaml) - **Tests :** [![CI](https://github.com/openscm/example-fgen-basic/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/openscm/example-fgen-basic/actions/workflows/ci.yaml) [![Coverage](https://codecov.io/gh/openscm/example-fgen-basic/branch/main/graph/badge.svg)](https://codecov.io/gh/openscm/example-fgen-basic) @@ -65,16 +60,6 @@ because of breaking updates to dependencies. The locked version of Example fgen - basic can be installed with -=== "mamba" - ```sh - mamba install -c conda-forge example-fgen-basic-locked - ``` - -=== "conda" - ```sh - conda install -c conda-forge example-fgen-basic-locked - ``` - === "pip" ```sh pip install 'example-fgen-basic[locked]' @@ -99,16 +84,6 @@ please [raise an issue](https://github.com/openscm/example-fgen-basic/issues). The (non-locked) version of Example fgen - basic can be installed with -=== "mamba" - ```sh - mamba install -c conda-forge example-fgen-basic - ``` - -=== "conda" - ```sh - conda install -c conda-forge example-fgen-basic - ``` - === "pip" ```sh pip install example-fgen-basic @@ -116,16 +91,6 @@ The (non-locked) version of Example fgen - basic can be installed with Additional dependencies can be installed using -=== "mamba" - If you are installing with mamba, we recommend - installing the extras by hand because there is no stable - solution yet (see [conda issue #7502](https://github.com/conda/conda/issues/7502)) - -=== "conda" - If you are installing with conda, we recommend - installing the extras by hand because there is no stable - solution yet (see [conda issue #7502](https://github.com/conda/conda/issues/7502)) - === "pip" ```sh # To add plotting dependencies diff --git a/changelog/23.trivial.md b/changelog/23.trivial.md new file mode 100644 index 0000000..bd603f7 --- /dev/null +++ b/changelog/23.trivial.md @@ -0,0 +1,3 @@ +- Dropped conda-related things as we won't make the package installable via conda +- Added tests on more architectures to the test PyPI install workflow +- Removed FORD config from the source distribution diff --git a/docs/development.md b/docs/development.md index be984b8..4f16d59 100644 --- a/docs/development.md +++ b/docs/development.md @@ -106,15 +106,6 @@ The steps required are the following: This triggers a release to PyPI (which you can then add to the release if you want). -1. Go to your conda feedstock repository - (likely something like https://github.com/conda-forge/example-fgen-basic-feedstock) - and make a new merge request that updates your `recipe/meta.yaml` file - to point to the newly released version on PyPI. - - - If you have updated any dependencies, copy these across to your `recipe/meta.yaml` file. - - If you are releasing a locked version on conda too, - you can generate the pins for your lock file with `scripts/print-conda-recipe-pins.py`. - 1. That's it, release done, make noise on social media of choice, do whatever else diff --git a/scripts/print-conda-recipe-pins.py b/scripts/print-conda-recipe-pins.py deleted file mode 100644 index 8f243ae..0000000 --- a/scripts/print-conda-recipe-pins.py +++ /dev/null @@ -1,100 +0,0 @@ -""" -Write out the pins for our conda recipe - -These can be copy-pasted into the locked info at -https://github.com/conda-forge/example-fgen-basic-feedstock/blob/main/recipe/meta.yaml -""" - -from __future__ import annotations - -import tomli -import typer -from attrs import define -from packaging.version import Version - - -@define -class VersionInfoHere: - """Version info class for use in this script""" - - name: str - min_pin: str - max_pin: str - - -def main() -> None: - """ - Write our docs environment file for Read the Docs - """ - PYPROJECT_TOML_FILE = "pyproject.toml" - REQUIREMENTS_LOCK_FILE = "requirements-locked.txt" - - with open(PYPROJECT_TOML_FILE, "rb") as fh: - pyproject_toml = tomli.load(fh) - - with open(REQUIREMENTS_LOCK_FILE) as fh: - requirements_info = fh.read().splitlines() - - pypi_to_conda_name_map = { - "scitools-iris": "iris", - "cf-xarray": "cf_xarray", - "typing-extensions": "typing_extensions", - } - version_info_l = [] - for dependency in pyproject_toml["project"]["dependencies"]: - package_name = ( - dependency.split(">")[0].split("<")[0].split(">=")[0].split("<=")[0] - ) - - if package_name in pypi_to_conda_name_map: - conda_name = pypi_to_conda_name_map[package_name] - else: - conda_name = package_name - - if conda_name in (v.name for v in version_info_l): - print(f"Not re-processing {package_name}") - continue - - package_version_lines = [] - for line in requirements_info: - if line.startswith(package_name): - package_version_lines.append(line) - - if not package_version_lines: - msg = f"Didn't find pin information for {package_name}" - raise AssertionError(msg) - - if len(package_version_lines) == 1: - version = package_version_lines[0].split("==")[-1] # .split(";")[0] - vv = Version(version) - min_pin = version - max_pin = f"{vv.major}.{vv.minor}.{vv.micro + 1}" - else: - print(f"Using range for {dependency}. " f"{package_version_lines=}.") - versions = [ - # Assume some split based on Python version - Version(v.split(";")[0].split("==")[-1].strip()) - for v in package_version_lines - ] - min_pin = min(versions) - max_version = max(versions) - max_pin = f"{max_version.major}.{max_version.minor}.{max_version.micro + 1}" - - version_info_l.append( - VersionInfoHere(name=conda_name, min_pin=min_pin, max_pin=max_pin) - ) - - print("Pins for library") - for vi in version_info_l: - print(f"- {vi.name}") - - print("") - print("Pins for application") - for vi in version_info_l: - print( - f"- {{{{ pin_compatible('{vi.name}', lower_bound='{vi.min_pin}', upper_bound='{vi.max_pin}') }}}}" # noqa: E501 - ) - - -if __name__ == "__main__": - typer.run(main) diff --git a/scripts/strip-sdist.py b/scripts/strip-sdist.py index 9098e36..613cfa1 100644 --- a/scripts/strip-sdist.py +++ b/scripts/strip-sdist.py @@ -17,6 +17,7 @@ def main(): exclude = [ ".github", "docs", + "ford_config.md", "tests", "changelog", "stubs", @@ -25,7 +26,6 @@ def main(): Path("scripts") / "propogate-pyproject-metadata.py", Path("scripts") / "test-install.py", Path("scripts") / "changelog-to-release-template.py", - Path("scripts") / "print-conda-recipe-pins.py", # Keep this one # Path("scripts") / "strip-sdist.py", ".pre-commit-config.yaml",