From 5413053ef6a64dc01291ed19a4f9582609a33de3 Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 15:14:41 -0400 Subject: [PATCH 01/26] Add minimal setup.py --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..ad33f52 --- /dev/null +++ b/setup.py @@ -0,0 +1,4 @@ +# ruff: noqa: D100 +from setuptools import setup + +setup() From dd31f292b6818744162d62e3cd84e6dc34129661 Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 15:26:19 -0400 Subject: [PATCH 02/26] Switch dataclass to namedtuple --- tests/conftest.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 5852b37..4589560 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,18 +1,12 @@ -import dataclasses import os +from collections import namedtuple import pytest # ruff: noqa: N816. Allow mixed-case global variables -@dataclasses.dataclass -class CifData: - """Class to hold the filename and stored keys for a CIF file.""" - - filename: str - symop_keys: tuple[str] - atom_site_keys: tuple[str] +CifData = namedtuple("CifData", ["filename", "symop_keys", "atom_site_keys"]) box_keys = ( From c256e69ca059b7f2fd56f7c43df7030c486eeca6 Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 16:33:09 -0400 Subject: [PATCH 03/26] Fix typing for python < 3.7 --- parsnip/parse.py | 11 +++++------ parsnip/patterns.py | 6 +++--- setup.py | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/parsnip/parse.py b/parsnip/parse.py index baca349..8d7712c 100644 --- a/parsnip/parse.py +++ b/parsnip/parse.py @@ -1,5 +1,4 @@ """CIF parsing tools.""" - import warnings import numpy as np @@ -15,9 +14,9 @@ def _remove_comments_from_line(line): def read_table( filename: str, keys: str, - filter_line: tuple[tuple[str, str]] = ((r",\s+", ",")), + filter_line: tuple = ((r",\s+", ",")), keep_original_key_order=False, -) -> np.ndarray[str]: +) -> np.ndarray: r"""Extract data from a CIF file loop_ table. CIF files store tabular data as whitespace-delimited blocks that start with `loop_`. @@ -61,7 +60,7 @@ def read_table( Args: filename (str): The name of the .cif file to be parsed. keys (tuple[str]): The names of the keys to be parsed. - filter_line (tuple[tuple[str]], optional): + filter_line (tuple[tuple[str,str]], optional): A tuple of strings that are compiled to a regex filter and applied to each data line. (Default value: ((r",\s+",",")) ) keep_original_key_order (bool, optional): @@ -146,13 +145,13 @@ def read_table( def read_fractional_positions( filename: str, - filter_line: tuple[tuple[str, str]] = ((r",\s+", ",")), + filter_line: tuple = ((r",\s+", ",")), ): r"""Extract the fractional X,Y,Z coordinates from a CIF file. Args: filename (str): The name of the .cif file to be parsed. - filter_line (tuple[tuple[str]], optional): + filter_line (tuple[tuple[str,str]], optional): A tuple of strings that are compiled to a regex filter and applied to each data line. (Default value: ((r",\s+",",")) ) diff --git a/parsnip/patterns.py b/parsnip/patterns.py index f81923a..430a6ff 100644 --- a/parsnip/patterns.py +++ b/parsnip/patterns.py @@ -8,11 +8,11 @@ _comma_prune_spaces = re.compile(r",\s+") -def compile_pattern_from_strings(filter_patterns: tuple[str]): +def compile_pattern_from_strings(filter_patterns: tuple): """Return a regex pattern that matches any of the characters in the filter. Args: - filter_patterns (list[str]): Description + filter_patterns (tuple[str]): Description Returns: re.Pattern: Pattern matching any of the input characters. @@ -46,7 +46,7 @@ class LineCleaner: what that pattern will be replaced with. """ - def __init__(self, patterns: tuple[tuple[str, str]]): + def __init__(self, patterns: tuple): self.patterns, self.replacements = [], [] # If we only have a single tuple diff --git a/setup.py b/setup.py index ad33f52..b1a55cb 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ # ruff: noqa: D100 from setuptools import setup -setup() +setup(name="parsnip", version="0.0.2", python_requires=">=3.6") From 5384645130596751d126f84a56e138264a15dd07 Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 16:47:45 -0400 Subject: [PATCH 04/26] Split tests into two blocks --- .github/workflows/CI.yaml | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 9c5fe9e..99d5bab 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -1,31 +1,23 @@ name: Run Tests -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true +#concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true on: - # trigger on pull requests pull_request: - - # trigger on all commits to master push: branches: - "main" - "breaking" - - # trigger on request workflow_dispatch: + jobs: run_tests: - name: Run tests on ubuntu-latest with Python ${{ matrix.python-version }} runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - python-version: ["3.9","3.10","3.11","3.12"] steps: + # Steps common to both groups - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 @@ -38,8 +30,22 @@ jobs: - name: Install package run: | python --version - python -c "import numpy; print('numpy', numpy.__version__)" + python -c "import parsnip; print('parsnip', parsnip.__version__)" python -m pip install . -v --progress-bar off - name: Test with pytest run: | python -m pytest -v + + modern_python: + needs: run_tests + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.9, 3.10, 3.11, 3.12] + + legacy_python: + needs: run_tests + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] From 258103af0342e5309305f417547548230f0c8f1c Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 16:51:21 -0400 Subject: [PATCH 05/26] Add required workflow steps --- .github/workflows/CI.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 99d5bab..850fe23 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -42,6 +42,11 @@ jobs: strategy: matrix: python-version: [3.9, 3.10, 3.11, 3.12] + steps: + - name: Echo success + run: | + echo "Successfully ran tests for ${{ matrix.python-version }}" + legacy_python: needs: run_tests @@ -49,3 +54,7 @@ jobs: strategy: matrix: python-version: [3.6, 3.7, 3.8] + steps: + - name: Echo success + run: | + echo "Successfully ran tests for ${{ matrix.python-version }}" From cc4cb60ddef8e7c5a14d9d25dfd72140ec96854b Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 16:52:28 -0400 Subject: [PATCH 06/26] pip install -r --- .github/workflows/CI.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 850fe23..bdcce40 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -25,8 +25,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install requirements.txt - python -m pip install tests/requirements.txt + python -m pip install -r requirements.txt + python -m pip install -r tests/requirements.txt - name: Install package run: | python --version From 05393d88e15d066e84ef329767f1e422632d3c9b Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 16:53:28 -0400 Subject: [PATCH 07/26] Add pytest to reqs --- tests/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/requirements.txt b/tests/requirements.txt index b6d2376..0115446 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1 +1,2 @@ gemmi +pytest From 32984ad873ba5448b7e158603cfaea959bc59108 Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 16:54:10 -0400 Subject: [PATCH 08/26] Rename CI features --- .github/workflows/CI.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index bdcce40..f300d18 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -14,7 +14,7 @@ on: jobs: - run_tests: + set_up_tests: runs-on: ubuntu-latest steps: # Steps common to both groups @@ -36,8 +36,8 @@ jobs: run: | python -m pytest -v - modern_python: - needs: run_tests + modern_python_tests: + needs: set_up_tests runs-on: ubuntu-latest strategy: matrix: @@ -48,8 +48,8 @@ jobs: echo "Successfully ran tests for ${{ matrix.python-version }}" - legacy_python: - needs: run_tests + legacy_python_tests: + needs: set_up_tests runs-on: ubuntu-latest strategy: matrix: From 0646b07fd45878397b42f7f2440a647ca76433e8 Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 19:35:53 -0400 Subject: [PATCH 09/26] Properly implement workflow_call procedure --- .github/workflows/CI.yaml | 44 ++++---------------------------- .github/workflows/run_tests.yaml | 31 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/run_tests.yaml diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index f300d18..6e36fc4 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -14,47 +14,13 @@ on: jobs: - set_up_tests: - runs-on: ubuntu-latest - steps: - # Steps common to both groups - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install -r requirements.txt - python -m pip install -r tests/requirements.txt - - name: Install package - run: | - python --version - python -c "import parsnip; print('parsnip', parsnip.__version__)" - python -m pip install . -v --progress-bar off - - name: Test with pytest - run: | - python -m pytest -v - modern_python_tests: - needs: set_up_tests runs-on: ubuntu-latest strategy: + fail-fast: true matrix: python-version: [3.9, 3.10, 3.11, 3.12] - steps: - - name: Echo success - run: | - echo "Successfully ran tests for ${{ matrix.python-version }}" - - - legacy_python_tests: - needs: set_up_tests - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.6, 3.7, 3.8] - steps: - - name: Echo success - run: | - echo "Successfully ran tests for ${{ matrix.python-version }}" + # Pull in the test script from run_tests and distribute python from matrix versions + uses: ./.github/workflows/run_tests.yaml + with: + python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml new file mode 100644 index 0000000..f37d7b5 --- /dev/null +++ b/.github/workflows/run_tests.yaml @@ -0,0 +1,31 @@ +name: Run tests + +on: + workflow_call: + inputs: + python-version: + required: true + type: string + +jobs: + run_test: + runs-on: ubuntu-latest + steps: + # Steps common to both groups + - uses: actions/checkout@v4 + - name: Set up Python ${{ inputs.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python-version }} + - name: Install dependencies + run: | + python -m pip install -r requirements.txt + python -m pip install -r tests/requirements.txt + - name: Install package + run: | + python --version + python -m pip install . -v --progress-bar off + python -c "import parsnip; print('parsnip', parsnip.__version__)" + - name: Test with pytest + run: | + python -m pytest -v From f4c5a6d6e7a2c292df3665b5f50111562a659e4a Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 19:37:45 -0400 Subject: [PATCH 10/26] Remove incorrect runs_on key --- .github/workflows/CI.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 6e36fc4..9c0e542 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -15,7 +15,6 @@ on: jobs: modern_python_tests: - runs-on: ubuntu-latest strategy: fail-fast: true matrix: From 805c151af1bf525aa3a59f334dc3560473be0ebe Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 19:41:27 -0400 Subject: [PATCH 11/26] Rename action --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 9c0e542..cbfe7b1 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -14,7 +14,7 @@ on: jobs: - modern_python_tests: + run_tests: strategy: fail-fast: true matrix: From dccbd6d0c882fcbb03ae5a7e2df9db3b2110308d Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 19:43:12 -0400 Subject: [PATCH 12/26] Fix syntax in CI --- .github/workflows/CI.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index cbfe7b1..eb3d989 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -14,12 +14,21 @@ on: jobs: - run_tests: + test_modern: strategy: fail-fast: true matrix: - python-version: [3.9, 3.10, 3.11, 3.12] + python-version: ["3.9", "3.10", "3.11", "3.12"] # Pull in the test script from run_tests and distribute python from matrix versions uses: ./.github/workflows/run_tests.yaml with: python-version: ${{ matrix.python-version }} + + test_legacy: + strategy: + fail-fast: true + matrix: + python-version: ["3.6", "3.7", "3.8"] + uses: ./.github/workflows/run_tests.yaml + with: + python-version: ${{ matrix.python-version }} From 1321804f62db7ea4bdbb896177cc551b9f03a25a Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 19:45:44 -0400 Subject: [PATCH 13/26] Set legacy tests to run after modern versions pass --- .github/workflows/CI.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index eb3d989..e67101d 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -25,6 +25,7 @@ jobs: python-version: ${{ matrix.python-version }} test_legacy: + needs: test_modern # Wait until modern version pass to run legacy tests. strategy: fail-fast: true matrix: From 9275e93fa678c64aa9f2865e7f338aa1150d8a3e Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 19:47:55 -0400 Subject: [PATCH 14/26] Clean up CI script --- .github/workflows/CI.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index e67101d..6f9aaa5 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -1,9 +1,5 @@ name: Run Tests -#concurrency: -# group: ${{ github.workflow }}-${{ github.ref }} -# cancel-in-progress: true - on: pull_request: push: From 157286cc90574ea36fbca574bba231f98be41e5d Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 19:49:30 -0400 Subject: [PATCH 15/26] Clean up action names --- .github/workflows/CI.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 6f9aaa5..7f72421 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -10,7 +10,7 @@ on: jobs: - test_modern: + run-tests-modern-python: strategy: fail-fast: true matrix: @@ -20,8 +20,8 @@ jobs: with: python-version: ${{ matrix.python-version }} - test_legacy: - needs: test_modern # Wait until modern version pass to run legacy tests. + run-tests-legacy-python: + needs: run-tests-modern-python # Wait until tests pass on python 3.9+ strategy: fail-fast: true matrix: From 3e346fa9217e266231b8e7324190af9e28c12faa Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 20:19:07 -0400 Subject: [PATCH 16/26] Parameterize runs-on --- .github/workflows/CI.yaml | 4 ++++ .github/workflows/run_tests.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 7f72421..55f00bf 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -15,10 +15,12 @@ jobs: fail-fast: true matrix: python-version: ["3.9", "3.10", "3.11", "3.12"] + runs-on: ["ubuntu-latest"] # Pull in the test script from run_tests and distribute python from matrix versions uses: ./.github/workflows/run_tests.yaml with: python-version: ${{ matrix.python-version }} + runs-on: ${{ matrix.runs-on }} run-tests-legacy-python: needs: run-tests-modern-python # Wait until tests pass on python 3.9+ @@ -26,6 +28,8 @@ jobs: fail-fast: true matrix: python-version: ["3.6", "3.7", "3.8"] + runs-on: ["ubuntu-22.04"] uses: ./.github/workflows/run_tests.yaml with: python-version: ${{ matrix.python-version }} + runs-on: ${{ matrix.runs-on }} diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index f37d7b5..49db815 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -9,7 +9,7 @@ on: jobs: run_test: - runs-on: ubuntu-latest + runs-on: ${{ inputs.runs-on }} steps: # Steps common to both groups - uses: actions/checkout@v4 From c24fc5866beb9542ad35d8babdcd98ec6c892790 Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 20:20:10 -0400 Subject: [PATCH 17/26] Add runs-on input to workflow callable --- .github/workflows/run_tests.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 49db815..97e853b 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -6,6 +6,9 @@ on: python-version: required: true type: string + runs-on: + required: true + type: string jobs: run_test: From 0b99c4393040b06bc30e414b3ddda1e55e373520 Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 20:21:56 -0400 Subject: [PATCH 18/26] Move python 3.6 tests to ubuntu 20.04 --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 55f00bf..cdc6286 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -28,7 +28,7 @@ jobs: fail-fast: true matrix: python-version: ["3.6", "3.7", "3.8"] - runs-on: ["ubuntu-22.04"] + runs-on: ["ubuntu-20.04"] uses: ./.github/workflows/run_tests.yaml with: python-version: ${{ matrix.python-version }} From 4306088a8ae420dc52d2a109a6bd4006a2063168 Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 20:28:18 -0400 Subject: [PATCH 19/26] Test python 3.5 --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index cdc6286..4274c18 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: true matrix: - python-version: ["3.6", "3.7", "3.8"] + python-version: ["3.5","3.6", "3.7", "3.8"] runs-on: ["ubuntu-20.04"] uses: ./.github/workflows/run_tests.yaml with: From 266d5746948ee45729f48b95ad37aeb521a1626d Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 20:48:24 -0400 Subject: [PATCH 20/26] Remove broken python 3.5 --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 4274c18..cdc6286 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: true matrix: - python-version: ["3.5","3.6", "3.7", "3.8"] + python-version: ["3.6", "3.7", "3.8"] runs-on: ["ubuntu-20.04"] uses: ./.github/workflows/run_tests.yaml with: From f939f6409cd5941225292bd75f9e6628d2b81320 Mon Sep 17 00:00:00 2001 From: janbridley Date: Fri, 10 May 2024 21:01:59 -0400 Subject: [PATCH 21/26] Update install files --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8e6412d..2fb22f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "parsnip" version = "0.0.2" -requires-python = ">=3.9" +requires-python = ">=3.6" description = "Minimal library for parsing CIF/mmCIF files in Python." readme = "README.md" license = { file = "LICENSE" } diff --git a/setup.py b/setup.py index b1a55cb..1c7fac8 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ # ruff: noqa: D100 from setuptools import setup -setup(name="parsnip", version="0.0.2", python_requires=">=3.6") +setup(name="parsnip") From adabd29829d3489a782258742543870e0d998001 Mon Sep 17 00:00:00 2001 From: janbridley Date: Thu, 16 May 2024 12:31:23 -0400 Subject: [PATCH 22/26] Swapped requirements.txt with requirements.in --- doc/requirements.in | 4 +++ doc/requirements.txt | 64 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 doc/requirements.in diff --git a/doc/requirements.in b/doc/requirements.in new file mode 100644 index 0000000..6480824 --- /dev/null +++ b/doc/requirements.in @@ -0,0 +1,4 @@ +autodocsumm==0.2.12 +furo==2024.5.6 +numpy>=1.26.4 +sphinx==7.3.7 diff --git a/doc/requirements.txt b/doc/requirements.txt index 26cd033..3be342f 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,4 +1,66 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --strip-extras requirements.in +# +alabaster==0.7.16 + # via sphinx autodocsumm==0.2.12 + # via -r requirements.in +babel==2.15.0 + # via sphinx +beautifulsoup4==4.12.3 + # via furo +certifi==2024.2.2 + # via requests +charset-normalizer==3.3.2 + # via requests +docutils==0.21.2 + # via sphinx furo==2024.5.6 -numpy>=1.19 + # via -r requirements.in +idna==3.7 + # via requests +imagesize==1.4.1 + # via sphinx +jinja2==3.1.4 + # via sphinx +markupsafe==2.1.5 + # via jinja2 +numpy==1.26.4 + # via -r requirements.in +packaging==24.0 + # via sphinx +pygments==2.18.0 + # via + # furo + # sphinx +requests==2.31.0 + # via sphinx +snowballstemmer==2.2.0 + # via sphinx +soupsieve==2.5 + # via beautifulsoup4 sphinx==7.3.7 + # via + # -r requirements.in + # autodocsumm + # furo + # sphinx-basic-ng +sphinx-basic-ng==1.0.0b2 + # via furo +sphinxcontrib-applehelp==1.0.8 + # via sphinx +sphinxcontrib-devhelp==1.0.6 + # via sphinx +sphinxcontrib-htmlhelp==2.0.5 + # via sphinx +sphinxcontrib-jsmath==1.0.1 + # via sphinx +sphinxcontrib-qthelp==1.0.7 + # via sphinx +sphinxcontrib-serializinghtml==1.1.10 + # via sphinx +urllib3==2.2.1 + # via requests From 6ba81a61ca638bfc6a64d234341a9085e0b770ed Mon Sep 17 00:00:00 2001 From: janbridley Date: Thu, 16 May 2024 12:35:42 -0400 Subject: [PATCH 23/26] Swapped tests requirements.txt with requirements.in --- tests/requirements.in | 2 ++ tests/requirements.txt | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tests/requirements.in diff --git a/tests/requirements.in b/tests/requirements.in new file mode 100644 index 0000000..946cb29 --- /dev/null +++ b/tests/requirements.in @@ -0,0 +1,2 @@ +gemmi==0.6.5 +pytest==8.2.0 diff --git a/tests/requirements.txt b/tests/requirements.txt index 0115446..ee7a087 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,2 +1,16 @@ -gemmi -pytest +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --strip-extras requirements.in +# +gemmi==0.6.5 + # via -r requirements.in +iniconfig==2.0.0 + # via pytest +packaging==24.0 + # via pytest +pluggy==1.5.0 + # via pytest +pytest==8.2.0 + # via -r requirements.in From 20b45541e55b2e3b151facb27b2f0a736ecd2734 Mon Sep 17 00:00:00 2001 From: janbridley Date: Thu, 16 May 2024 13:00:01 -0400 Subject: [PATCH 24/26] Added legacy test requirements file --- .github/workflows/CI.yaml | 2 ++ .github/workflows/run_tests.yaml | 5 ++++- tests/requirements-legacy.in | 2 ++ tests/requirements-legacy.txt | 22 ++++++++++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tests/requirements-legacy.in create mode 100644 tests/requirements-legacy.txt diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index cdc6286..7506e87 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -21,6 +21,7 @@ jobs: with: python-version: ${{ matrix.python-version }} runs-on: ${{ matrix.runs-on }} + requirements-file: "tests/requirements.txt" run-tests-legacy-python: needs: run-tests-modern-python # Wait until tests pass on python 3.9+ @@ -33,3 +34,4 @@ jobs: with: python-version: ${{ matrix.python-version }} runs-on: ${{ matrix.runs-on }} + requirements-file: "tests/requirements-legacy.txt" diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 97e853b..855c3fa 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -9,6 +9,9 @@ on: runs-on: required: true type: string + requirements-file: + required: true + type: string jobs: run_test: @@ -23,7 +26,7 @@ jobs: - name: Install dependencies run: | python -m pip install -r requirements.txt - python -m pip install -r tests/requirements.txt + python -m pip install -r ${{ inputs.requirements-file }} - name: Install package run: | python --version diff --git a/tests/requirements-legacy.in b/tests/requirements-legacy.in new file mode 100644 index 0000000..51f0c34 --- /dev/null +++ b/tests/requirements-legacy.in @@ -0,0 +1,2 @@ +gemmi==0.6.5 +pytest==7.0.1 diff --git a/tests/requirements-legacy.txt b/tests/requirements-legacy.txt new file mode 100644 index 0000000..d459efd --- /dev/null +++ b/tests/requirements-legacy.txt @@ -0,0 +1,22 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --strip-extras requirements-legacy.in +# +attrs==23.2.0 + # via pytest +gemmi==0.6.5 + # via -r requirements-legacy.in +iniconfig==2.0.0 + # via pytest +packaging==24.0 + # via pytest +pluggy==1.5.0 + # via pytest +py==1.11.0 + # via pytest +pytest==7.0.1 + # via -r requirements-legacy.in +tomli==2.0.1 + # via pytest From a81bb51fbdfe13aea196c3820a63d9a53b3e9905 Mon Sep 17 00:00:00 2001 From: janbridley Date: Thu, 16 May 2024 13:10:15 -0400 Subject: [PATCH 25/26] Fixed pin and reran pip-compile on python 3.6 --- tests/requirements-legacy.in | 2 +- tests/requirements-legacy.txt | 28 +++++++++++++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/tests/requirements-legacy.in b/tests/requirements-legacy.in index 51f0c34..c9e5797 100644 --- a/tests/requirements-legacy.in +++ b/tests/requirements-legacy.in @@ -1,2 +1,2 @@ -gemmi==0.6.5 +gemmi==0.6.3 pytest==7.0.1 diff --git a/tests/requirements-legacy.txt b/tests/requirements-legacy.txt index d459efd..1f9c539 100644 --- a/tests/requirements-legacy.txt +++ b/tests/requirements-legacy.txt @@ -1,22 +1,32 @@ # -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: +# This file is autogenerated by pip-compile with python 3.6 +# To update, run: # -# pip-compile --strip-extras requirements-legacy.in +# pip-compile requirements-legacy.in # -attrs==23.2.0 +attrs==22.2.0 # via pytest -gemmi==0.6.5 +gemmi==0.6.3 # via -r requirements-legacy.in -iniconfig==2.0.0 +importlib-metadata==4.8.3 + # via + # pluggy + # pytest +iniconfig==1.1.1 # via pytest -packaging==24.0 +packaging==21.3 # via pytest -pluggy==1.5.0 +pluggy==1.0.0 # via pytest py==1.11.0 # via pytest +pyparsing==3.1.2 + # via packaging pytest==7.0.1 # via -r requirements-legacy.in -tomli==2.0.1 +tomli==1.2.3 # via pytest +typing-extensions==4.1.1 + # via importlib-metadata +zipp==3.6.0 + # via importlib-metadata From 9dcd291a89df0c9cf18a04017c9708d87df3102e Mon Sep 17 00:00:00 2001 From: janbridley Date: Thu, 16 May 2024 13:21:01 -0400 Subject: [PATCH 26/26] Set default value for requirements-file --- .github/workflows/CI.yaml | 1 - .github/workflows/run_tests.yaml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 7506e87..3f390ee 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -21,7 +21,6 @@ jobs: with: python-version: ${{ matrix.python-version }} runs-on: ${{ matrix.runs-on }} - requirements-file: "tests/requirements.txt" run-tests-legacy-python: needs: run-tests-modern-python # Wait until tests pass on python 3.9+ diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 855c3fa..e3e125a 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -10,7 +10,7 @@ on: required: true type: string requirements-file: - required: true + default: "tests/requirements.txt" type: string jobs: