Skip to content

Commit

Permalink
ci: remove reference to setuptools issue across CI
Browse files Browse the repository at this point in the history
- This is no longer needed as Python ICAT 1.0 is now used, which doesn't require an older version of setuptools
  • Loading branch information
MRichards99 committed Apr 25, 2023
1 parent c24d980 commit bd0a1ad
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 59 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,6 @@ jobs:
- name: Create search_api_mapping.json
run: cp datagateway_api/search_api_mapping.json.example datagateway_api/search_api_mapping.json

- name: Uninstall setuptools
run: poetry run pip uninstall -y setuptools
- name: Install older setuptools
run: poetry run pip install 'setuptools<58.0.0'

- name: Install dependencies
run: poetry install

Expand Down Expand Up @@ -281,12 +276,6 @@ jobs:
- name: Install Poetry
run: pip install poetry==1.1.9

# Installing an older version of setuptools for reasons explained at: https://github.com/icatproject/python-icat/issues/99
- name: Uninstall setuptools
run: poetry run pip uninstall -y setuptools
- name: Install older setuptools
run: poetry run pip install 'setuptools<58.0.0'

- name: Install dependencies
run: poetry install

Expand Down Expand Up @@ -342,12 +331,6 @@ jobs:
- name: Create search_api_mapping.json
run: cd /home/runner/work/datagateway-api/datagateway-api; cp datagateway_api/search_api_mapping.json.example datagateway_api/search_api_mapping.json

# Installing an older version of setuptools for reasons explained at: https://github.com/icatproject/python-icat/issues/99
- name: Uninstall setuptools
run: poetry run pip uninstall -y setuptools
- name: Install older setuptools
run: poetry run pip install 'setuptools<58.0.0'

- name: Install dependencies
run: poetry install

Expand Down
16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,22 +371,6 @@ Poetry environment:
ModuleNotFoundError: No module named 'urlparse'
```

Explanation of the cause for this issue can be found in a
[Python ICAT issue](https://github.com/icatproject/python-icat/issues/99). Essentially,
the version of `setuptools` used must be < 58.0.0
([see above](#api-dependency-management-poetry) for further details). If you have
already installed the API's dependencies (via `poetry install`), you will need to re-install `setuptools` (using a suitable version) and re-install Python ICAT so it can be rebuilt correctly. The following commands can be used for this process:

```bash
# Uninstall and re-install setuptools using a version < 58.0.0
poetry run pip uninstall -y setuptools
poetry run pip install 'setuptools<58.0.0'

# Re-install Python ICAT so it can be built properly
poetry remove python-icat
poetry add python-icat=0.21.0
```

If using Python 3.10, please use Payara 5 on the ICAT stack which the API is being
pointed at. There is a known issue when making HTTPS connections to Payara (via Python
ICAT).
Expand Down
26 changes: 0 additions & 26 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,38 +110,12 @@ def safety(session):
@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10"], reuse_venv=True)
def unit_tests(session):
args = session.posargs
# Installing setuptools that will work with `2to3` which is used when building
# `python-icat` < 1.0. 58.0.0 removes support of this tool during builds:
# https://setuptools.pypa.io/en/latest/history.html#v58-0-0
# Ideally this would be done within `pyproject.toml` but specifying `setuptools` as
# a dependency requires Poetry 1.2:
# https://github.com/python-poetry/poetry/issues/4511#issuecomment-922420457
# Currently, only a pre-release exists for Poetry 1.2. Testing on the pre-release
# version didn't fix the `2to3` issue when building Python ICAT, perhaps because
# Python ICAT isn't built on the downgraded version for some reason?
session.run("pip", "uninstall", "-y", "setuptools")
# Not using `poetry run` as it errors on Windows OS when a version with the '<'
# sign is specified for a package
session.run("pip", "install", "setuptools<58.0.0")
session.run("poetry", "install", external=True)
session.run("pytest", "test/unit", *args)


@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10"], reuse_venv=True)
def integration_tests(session):
args = session.posargs
# Installing setuptools that will work with `2to3` which is used when building
# `python-icat` < 1.0. 58.0.0 removes support of this tool during builds:
# https://setuptools.pypa.io/en/latest/history.html#v58-0-0
# Ideally this would be done within `pyproject.toml` but specifying `setuptools` as
# a dependency requires Poetry 1.2:
# https://github.com/python-poetry/poetry/issues/4511#issuecomment-922420457
# Currently, only a pre-release exists for Poetry 1.2. Testing on the pre-release
# version didn't fix the `2to3` issue when building Python ICAT, perhaps because
# Python ICAT isn't built on the downgraded version for some reason?
session.run("pip", "uninstall", "-y", "setuptools")
# Not using `poetry run` as it errors on Windows OS when a version with the '<'
# sign is specified for a package
session.run("pip", "install", "setuptools<58.0.0")
session.run("poetry", "install", external=True)
session.run("pytest", "test/integration", *args)

0 comments on commit bd0a1ad

Please sign in to comment.