Skip to content

Commit 5543557

Browse files
authored
Update python version and fix testing issues (#329)
* use a stable url for testing The BGC_GBK_URL changes from time to time * update gnps website down function * add condition of gnps website down for tests * update python min version from 3.9 to 3.11 it is required by BigScape2
1 parent 3f46403 commit 5543557

14 files changed

Lines changed: 50 additions & 41 deletions

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ on:
3030
jobs:
3131

3232
smoke_test:
33-
name: Smoke test on ubuntu for python 3.10
33+
name: Smoke test on ubuntu for python 3.11
3434
runs-on: ubuntu-latest
3535
if: github.event.pull_request.draft == false
3636
steps:
3737
- uses: actions/checkout@v4
38-
- name: Set up Python 3.10
38+
- name: Set up Python 3.11
3939
uses: actions/setup-python@v3
4040
with:
41-
python-version: '3.10'
41+
python-version: '3.11'
4242
- name: Python info
4343
shell: bash -l {0}
4444
run: |
@@ -64,7 +64,7 @@ jobs:
6464
fail-fast: false
6565
matrix:
6666
os: ['ubuntu-latest']
67-
python-version: ['3.9', '3.11']
67+
python-version: ['3.12']
6868
steps:
6969
- uses: actions/checkout@v4
7070
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up Python
2424
uses: actions/setup-python@v5
2525
with:
26-
python-version: '3.10'
26+
python-version: '3.11'
2727

2828
- name: Install dependencies
2929
run: python3 -m pip install .[dev]

.github/workflows/format-typing-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
runs-on: ubuntu-latest
3131
steps:
3232
- uses: actions/checkout@v4
33-
- name: Set up Python 3.10
33+
- name: Set up Python 3.11
3434
uses: actions/setup-python@v3
3535
with:
36-
python-version: '3.10'
36+
python-version: '3.11'
3737
- name: Install ruff and mypy
3838
run: |
3939
pip install ruff mypy typing_extensions \

.github/workflows/sonar-cloud.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Set up Python
4444
uses: actions/setup-python@v3
4545
with:
46-
python-version: '3.10'
46+
python-version: '3.11'
4747
- name: Install nplinker and its dependencies
4848
run: |
4949
python3 -m pip install -e .[dev]

README.dev.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ If you want to add more settings, you can update the workspace settings, see [th
1616

1717
## Setup
1818

19-
We use Python 3.10 for development environment.
19+
We use Python 3.11 for development environment.
2020

2121
```shell
2222
# Create a virtual environment
23-
conda create -n npl-dev python=3.10
23+
conda create -n npl-dev python=3.11
2424

2525
# activate virtual environment
2626
conda activate npl-dev
@@ -98,7 +98,7 @@ ruff format filename.py
9898

9999
We use [inline type annotation](https://typing.readthedocs.io/en/latest/source/libraries.html#how-to-provide-type-annotations) for static typing rather than stub files (i.e. `.pyi` files).
100100

101-
Since Python 3.10 is used as dev environment and NPLinker must support Python version ≥3.9, you may see various typing issues at runtime. Here is [a guide to solve the potential runtime issues](https://mypy.readthedocs.io/en/stable/runtime_troubles.html).
101+
Since Python 3.11 is used as dev environment (older NPLinker must support Python version ≥3.9), you may see various typing issues at runtime. Here is [a guide to solve the potential runtime issues](https://mypy.readthedocs.io/en/stable/runtime_troubles.html).
102102

103103
By default, we use `from __future__ import annotations` at module level to stop evaluating annotations at function definition time (see [PEP 563](https://peps.python.org/pep-0563/)), which would solve most of compatibility issues between different Python versions. Make sure you're aware of the [caveats](https://mypy.readthedocs.io/en/stable/runtime_troubles.html#future-annotations-import-pep-563).
104104

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Original paper: [Ranking microbial metabolomic and genomic links in the NPLinker
2626

2727
### Requirement
2828
- Linux, MacOS or [Windows with WSL](https://learn.microsoft.com/en-us/windows/wsl/)
29-
- Python version ≥3.9
29+
- Python version ≥3.11
3030

3131

3232
### Installation
@@ -35,8 +35,8 @@ requires <span style="color:red;">**~4.5GB**</span> of disk space to install all
3535

3636
```shell
3737
# Create a new virtual environment and activate it
38-
conda create -n npl-3.10 python=3.10
39-
conda activate npl-3.10
38+
conda create -n npl-3.11 python=3.11
39+
conda activate npl-3.11
4040

4141
# install from nplinker releases (requiring ~300MB of disk space)
4242
pip install --pre nplinker
@@ -51,8 +51,8 @@ To run the tests, you need to clone this repo and install the development depend
5151

5252
```shell
5353
# Create a new virtual environment
54-
conda create -n npl-3.10 python=3.10
55-
conda activate npl-3.10
54+
conda create -n npl-3.11 python=3.11
55+
conda activate npl-3.11
5656

5757
# Clone the repository and install the development dependencies
5858
git clone https://github.com/NPLinker/nplinker.git

docs/install.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
!!!- Note "Requirements"
33
- Linux, MacOS or [Windows with WSL](https://learn.microsoft.com/en-us/windows/wsl/)
4-
- Python version ≥3.9
4+
- Python version ≥3.11
55

66

77
NPLinker is a python package that has both pypi packages and non-pypi packages as dependencies. It
@@ -11,8 +11,8 @@ Install `nplinker` package as following:
1111

1212
```bash title="Install nplinker package"
1313
# Create a new virtual environment and activate it
14-
conda create -n npl-3.10 python=3.10 # (1)!
15-
conda activate npl-3.10
14+
conda create -n npl-3.11 python=3.11 # (1)!
15+
conda activate npl-3.11
1616

1717
# install nplinker package (requiring ~300MB of disk space)
1818
pip install --pre nplinker # (2)!

docs/webapp/readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ Follow these steps to install the application directly on your system:
8585

8686
2. **Set up a conda environment**
8787
```bash
88-
# Create a new conda environment with Python 3.10
89-
conda create -n nplinker-webapp python=3.10
88+
# Create a new conda environment with Python 3.11
89+
conda create -n nplinker-webapp python=3.11
9090

9191
# Activate the environment
9292
conda activate nplinker-webapp
@@ -113,7 +113,7 @@ Follow these steps to install the application directly on your system:
113113

114114
<ul>
115115
<li><strong>Port already in use</strong>: If port 8050 is already in use, modify the port in <code>app/main.py</code> by changing <code>app.run_server(debug=True, port=8050)</code></li>
116-
<li><strong>Package installation errors</strong>: Make sure you're using Python 3.10 and that your pip is up-to-date</li>
116+
<li><strong>Package installation errors</strong>: Make sure you're using Python 3.11 and that your pip is up-to-date</li>
117117
</ul>
118118

119119
<p>If you encounter other problems, please check the <a href="https://github.com/NPLinker/nplinker-webapp/issues">Issues</a> page or create a new issue.</p>

pyproject.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name = "nplinker"
99
version = "2.0.0-alpha.9"
1010
description = "Natural Products Linker"
1111
readme = "README.md"
12-
requires-python = ">=3.9"
12+
requires-python = ">=3.11"
1313
keywords = ["Genome", "Metabolome", "Natural Products", "Data Mining"]
1414
license = { text = "Apache-2.0 license" }
1515
classifiers = [
@@ -21,8 +21,6 @@ classifiers = [
2121
"Operating System :: MacOS",
2222
"Operating System :: POSIX :: Linux",
2323
"Programming Language :: Python :: 3",
24-
"Programming Language :: Python :: 3.9",
25-
"Programming Language :: Python :: 3.10",
2624
"Programming Language :: Python :: 3.11",
2725
"Programming Language :: Python :: 3.12",
2826
]
@@ -102,13 +100,13 @@ relative_files = true # show relative path in report, important for sonarcloud
102100
# Mypy: to check static type
103101
# see https://mypy.readthedocs.io/en/stable/config_file.html#example-pyproject-toml
104102
[tool.mypy]
105-
python_version = "3.10"
103+
python_version = "3.11"
106104
warn_return_any = true
107105
warn_unused_configs = true
108106
ignore_missing_imports = true
109107

110108
[tool.ruff]
111-
target-version = "py310"
109+
target-version = "py311"
112110
line-length = 100
113111

114112
[tool.ruff.lint]

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from setuptools import setup
44

55

6-
if sys.version_info[:2] < (3, 9):
7-
raise RuntimeError("Python version >= 3.9 required.")
6+
if sys.version_info[:2] < (3, 11):
7+
raise RuntimeError("Python version >= 3.11 required.")
88

99
setup(scripts=["bin/install-nplinker-deps"])

0 commit comments

Comments
 (0)