-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support new Python versions #73
Changes from all commits
fa395ea
72bfaca
607d4a9
de1002d
6e533cb
ea840a5
e1ac993
b33d7a9
2e49092
b3eba93
2a15acb
a238f23
f246f04
121d62c
4a547d5
28597ac
fc63c25
06f431c
e56a8e1
3972248
3bc2218
2294fb0
af63363
39f6ce7
3584ff6
4c1e2b3
f1a30d6
7d00ebb
a0fff70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
name: ci | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
env: | ||
UV_VER: "0.5.2" | ||
FORCE_COLOR: 1 | ||
|
||
jobs: | ||
|
||
|
@@ -9,12 +12,7 @@ jobs: | |
timeout-minutes: 30 | ||
strategy: | ||
matrix: | ||
python-version: ['3.9', '3.10'] | ||
editable_install_option: ['-e', ''] | ||
include: | ||
#Test for aiida-core 1.X (since aiida-core 2.X does not support python 3.7) | ||
- python-version: '3.7' | ||
editable_install_option: '-e' | ||
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can ask on the discourse and if no one using aiida-core < 2 with this anymore, maybe can drop the support for 3.7 and 3.8? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's have this discussion at #72. There I proposed to release the code basically as is (after renaming it) as version 0.1.0 so that existing users can easily switch to the official package. After that all breaking changes and droping support can be done in v0.2. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
btw: Dropping support for AiiDA v1 should anyway be done in a separate PR, since there will be a lot of code cleanup associated with that. |
||
fail-fast: false | ||
|
||
services: | ||
|
@@ -37,16 +35,19 @@ jobs: | |
- 5672:5672 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install python dependencies | ||
- name: Set up uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
version: ${{ env.UV_VER }} | ||
- name: Install package | ||
run: | | ||
pip install --upgrade pip | ||
pip install ${{ matrix.editable_install_option }} .[testing] | ||
uv pip install --system -e .[testing] | ||
reentry scan -r aiida || true | ||
|
||
- name: Run test suite | ||
|
@@ -61,34 +62,40 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.7 | ||
- name: Install python dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -e .[docs] | ||
reentry scan -r aiida || true | ||
python-version: '3.12' | ||
|
||
- name: Set up uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
version: ${{ env.UV_VER }} | ||
- name: Install package | ||
run: uv pip install --system -e .[docs] | ||
|
||
- name: Build docs | ||
run: cd docs && make | ||
|
||
pre-commit: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v1 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
- name: Install python dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -e .[pre_commit] | ||
reentry scan -r aiida || true | ||
python-version: '3.12' | ||
|
||
- name: Set up uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
version: ${{ env.UV_VER }} | ||
|
||
- name: Install package | ||
run: uv pip install --system -e .[pre_commit] | ||
|
||
- name: Run pre-commit | ||
run: | | ||
pre-commit install | ||
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) | ||
uses: pre-commit/[email protected] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Sphinx configuration for aiida-testing | ||
# | ||
# This file is execfile()d with the current directory set to its | ||
|
@@ -16,12 +14,7 @@ | |
import time | ||
import contextlib | ||
|
||
from aiida.manage.configuration import load_documentation_profile | ||
|
||
import aiida_testing | ||
|
||
load_documentation_profile() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was removed since it is no longer needed in AiiDA 2.0 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was dropped at 2.5.0: https://github.com/aiidateam/aiida-core/blob/main/CHANGELOG.md#v250---2023-12-20 |
||
|
||
# -- AiiDA-related setup -------------------------------------------------- | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
|
@@ -37,7 +30,6 @@ | |
with contextlib.suppress(ImportError): | ||
import sphinx_rtd_theme | ||
html_theme = 'sphinx_rtd_theme' | ||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apparently no longer necessary, generated a warning |
||
|
||
# -- General configuration ------------------------------------------------ | ||
|
||
|
@@ -56,7 +48,7 @@ | |
|
||
intersphinx_mapping = { | ||
'python': ('https://docs.python.org/3', None), | ||
'aiida': ('http://aiida-core.readthedocs.io/en/v1.6.8/', None), | ||
'aiida': ('https://aiida.readthedocs.io/projects/aiida-core/en/stable/', None), | ||
'pytest': ('https://docs.pytest.org/en/latest/', None) | ||
} | ||
|
||
|
@@ -66,24 +58,18 @@ | |
# The suffix of source filenames. | ||
source_suffix = '.rst' | ||
|
||
# The encoding of source files. | ||
#source_encoding = 'utf-8-sig' | ||
|
||
# The master toctree document. | ||
#~ master_doc = 'index' | ||
master_doc = 'index' | ||
|
||
# General information about the project. | ||
project = u'aiida-testing' | ||
project = 'aiida-testing' | ||
copyright_first_year = "2019" | ||
copyright_owners = "The AiiDA Team" | ||
|
||
current_year = str(time.localtime().tm_year) | ||
copyright_year_string = current_year if current_year == copyright_first_year else "{}-{}".format( | ||
copyright_first_year, current_year | ||
) | ||
copyright_year_string = current_year if current_year == copyright_first_year else f"{copyright_first_year}-{current_year}" | ||
# pylint: disable=redefined-builtin | ||
copyright = u'{}, {}. All rights reserved'.format(copyright_year_string, copyright_owners) | ||
copyright = f'{copyright_year_string}, {copyright_owners}. All rights reserved' | ||
|
||
# The version info for the project you're documenting, acts as replacement for | ||
# |version| and |release|, also used in various other places throughout the | ||
|
@@ -146,9 +132,7 @@ | |
# Theme options are theme-specific and customize the look and feel of a theme | ||
# further. For a list of options available for each theme, see the | ||
# documentation. | ||
html_theme_options = { | ||
'display_version': True, | ||
} | ||
# html_theme_options = {} | ||
|
||
# Add any paths that contain custom themes here, relative to this directory. | ||
#~ html_theme_path = ["."] | ||
|
@@ -221,9 +205,6 @@ | |
#html_file_suffix = None | ||
|
||
# Language to be used for generating the HTML full-text search index. | ||
# Sphinx supports the following languages: | ||
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' | ||
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' | ||
html_search_language = 'en' | ||
|
||
# A dictionary with options for the search language support, empty by default. | ||
|
@@ -292,11 +273,6 @@ def run_apidoc(_): | |
apidoc_dir = os.path.join(source_dir, 'apidoc') | ||
package_dir = os.path.join(source_dir, os.pardir, os.pardir, 'aiida_testing') | ||
|
||
# In #1139, they suggest the route below, but this ended up | ||
# calling sphinx-build, not sphinx-apidoc | ||
#from sphinx.apidoc import main | ||
#main([None, '-e', '-o', apidoc_dir, package_dir, '--force']) | ||
|
||
import subprocess | ||
cmd_path = 'sphinx-apidoc' | ||
if hasattr(sys, 'real_prefix'): # Check to see if we are in a virtualenv | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,8 @@ classifiers = [ | |
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Scientific/Engineering :: Physics", | ||
"Framework :: AiiDA", | ||
"Framework :: Pytest", | ||
|
@@ -39,10 +41,12 @@ keywords = [ | |
] | ||
urls = {Homepage = "https://aiida-testing.readthedocs.io/"} | ||
requires-python = ">=3.7" | ||
# Note the dependency on setuptools due to pkg_resources | ||
dependencies = [ | ||
"aiida-core>=1.0.0,<3.0.0", | ||
"pytest>=3.6", | ||
"aiida-core>=1.0.0,<2.3", | ||
"pytest>=7.0", | ||
"voluptuous~=0.12", | ||
"setuptools", | ||
] | ||
|
||
[project.optional-dependencies] | ||
|
@@ -55,20 +59,13 @@ testing = [ | |
] | ||
pre_commit = [ | ||
"pre-commit", | ||
"pylint~=2.12.2", | ||
"mypy==0.930", | ||
"pylint~=3.3.1", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm gonna get rid of pylint for ruff, but in a separate PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I begin to really appreciate the beauty of single rust binaries, this pylint pin was a reason why the installation for newer Python versions did not work. :-( |
||
"mypy==1.13", | ||
"types-setuptools==65.7.0.3", | ||
"types-PyYAML", | ||
] | ||
dev = [ | ||
"sphinx", | ||
"sphinx-rtd-theme", | ||
"pgtest~=1.3.1", | ||
"aiida-diff", | ||
"pytest-datadir", | ||
"pre-commit", | ||
"pylint~=2.12.2", | ||
"mypy==0.930", | ||
'aiida-testing[testing,pre_commit,docs]', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Self-referencing extras are allowed in |
||
] | ||
|
||
[project.scripts] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just test non-editable install here, we install editably in pre-commit and docs jobs anyway.