Skip to content

Commit 5045b1e

Browse files
authored
Merge pull request #260 from hamogu/CI
Update dependencies on CI
2 parents 780a62a + 92db1ef commit 5045b1e

28 files changed

Lines changed: 296 additions & 1064 deletions

.github/workflows/ci_tests.yml

Lines changed: 42 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,89 +13,82 @@ on:
1313
# branches: # only build on PRs against 'main' if you need to further limit when CI is run.
1414
# - main
1515

16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
21+
permissions:
22+
contents: read
23+
24+
env:
25+
SETUP_XVFB: True # avoid issues if mpl tries to open a GUI window
26+
TOXARGS: '-v'
27+
28+
1629
jobs:
1730
# Github Actions supports ubuntu, windows, and macos virtual environments:
1831
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
1932
ci_tests:
2033
name: ${{ matrix.name }}
2134
runs-on: ${{ matrix.os }}
35+
if: "!(contains(github.event.head_commit.message, '[skip ci]') || contains(github.event.head_commit.message, '[ci skip]'))"
2236
strategy:
2337
matrix:
2438
include:
2539
#- name: Code style checks
2640
# os: ubuntu-latest
2741
# python: 3.x
28-
# toxenv: codestyle
42+
# tox_env: codestyle
2943

30-
- name: Python 3.10 with sherpa fitting
44+
- name: Python 3.12 with sherpa fitting
3145
os: ubuntu-latest
32-
python: "3.10"
33-
toxenv: py310-test-fit
46+
python: "3.12"
47+
tox_env: 'py312-test-fit'
3448

3549
#- name: Python 3.8 with all optional dependencies and coverage checking
3650
# os: ubuntu-latest
3751
# python: 3.8
38-
# toxenv: py38-test-alldeps-cov
39-
40-
# - name: OS X - Python 3.8 with all optional dependencies
41-
# os: macos-latest
42-
# python: 3.8
43-
# toxenv: py38-test-alldeps
44-
45-
# - name: Windows - Python 3.8 with all optional dependencies
46-
# os: windows-latest
47-
# python: 3.8
48-
# toxenv: py38-test-alldeps
52+
# tox_env: py38-test-alldeps-cov
4953

5054
# - name: Python 3.7 with oldest supported version of all dependencies
5155
# os: ubuntu-16.04
5256
# python: 3.7
53-
# toxenv: py37-test-oldestdeps
57+
# tox_env: py37-test-oldestdeps
5458

55-
# - name: Python 3.8 with latest dev versions of key dependencies
56-
# os: ubuntu-latest
57-
# python: 3.8
58-
# toxenv: py38-test-devdeps
59+
- name: Python 3.14 with latest dev versions of key dependencies
60+
os: ubuntu-latest
61+
python: 3.14
62+
tox_env: 'py314-test-devdeps'
5963

6064
# - name: Test building of Sphinx docs
6165
# os: ubuntu-latest
6266
# python: 3.x
63-
# toxenv: build_docs
67+
# tox_env: build_docs
6468

6569
steps:
66-
- name: Checkout code
67-
uses: actions/checkout@v3
70+
- name: Check out repository
71+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6872
with:
6973
fetch-depth: 0
70-
- name: Set up python ${{ matrix.python }} on ${{ matrix.os }}
71-
uses: actions/setup-python@v3
74+
- name: Set up Python ${{ matrix.python }}
75+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
7276
with:
7377
python-version: ${{ matrix.python }}
74-
- name: Download and unpack marx C code
75-
run: |
76-
wget https://github.com/Chandra-MARX/marx/archive/v5.4.0.tar.gz
77-
tar -xvf v5.4.0.tar.gz
78-
- name: Install marx C code
78+
- name: Install base dependencies
7979
run: |
80-
cd marx-5.4.0
81-
./configure --prefix=$HOME/marx/ CFLAGS="-O2 -g -fPIC"
82-
make
83-
make install
84-
cd ..
85-
- name: configure setup.cfg
80+
python -m pip install --upgrade pip setuptools tox
81+
- name: Install marxs itself
8682
run: |
87-
sed -i.bak 's|srcdir =|srcdir = '"$(echo $PWD)"'/marx-5.4.0/|g' setup.cfg
88-
sed -i.bak 's|libdir =|libdir = '"$(echo $HOME)"'/marx/lib/|g' setup.cfg
89-
- name: Install base dependencies
83+
python -m pip install ".[test]"
84+
- name: Install graphviz dependency
85+
if: "endsWith(matrix.tox_env, 'build_docs')"
86+
run: sudo apt-get -y install graphviz
87+
- name: Print Python env
9088
run: |
91-
python -m pip install --upgrade pip
92-
python -m pip install tox codecov
93-
- name: Test with tox
89+
python --version
90+
python -m pip list
91+
- name: Run tests
9492
run: |
95-
tox -e ${{ matrix.toxenv }}
96-
# This is an example of how to upload coverage to codecov
97-
# - name: Upload coverage to codecov
98-
# if: "contains(matrix.toxenv, '-cov')"
99-
# uses: codecov/codecov-action@v1
100-
# with:
101-
# file: ./coverage.xml
93+
python -m tox -e ${{ matrix.tox_env }} -- ${{ matrix.toxposargs }}
94+

.readthedocs.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,4 @@ python:
2222
path: .
2323
extra_requirements:
2424
- docs
25-
- requirements: docs/requirements.txt
2625

27-
formats: []

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ New Features
1111
API Changes
1212
^^^^^^^^^^^
1313

14+
- ``marxs.version`` has been removed. Use ``marxs.__version__`` instead which is
15+
default throughout the Python ecosystem. [#260]
16+
1417
Bug fixes
1518
^^^^^^^^^
1619

docs/conf.py

Lines changed: 17 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,24 @@
11
# -*- coding: utf-8 -*-
2-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
3-
#
4-
# Astropy documentation build configuration file.
5-
#
6-
# This file is execfile()d with the current directory set to its containing dir.
7-
#
8-
# Note that not all possible configuration values are present in this file.
9-
#
10-
# All configuration values have a default. Some values are defined in
11-
# the global Astropy configuration which is loaded here before anything else.
12-
# See astropy.sphinx.conf for which values are set there.
13-
14-
# If extensions (or modules to document with autodoc) are in another directory,
15-
# add these directories to sys.path here. If the directory is relative to the
16-
# documentation root, use os.path.abspath to make it absolute, like shown here.
17-
# sys.path.insert(0, os.path.abspath('..'))
18-
# IMPORTANT: the above commented section was generated by sphinx-quickstart, but
19-
# is *NOT* appropriate for astropy or Astropy affiliated packages. It is left
20-
# commented out with this explanation to make it clear why this should not be
21-
# done. If the sys.path entry above is added, when the astropy.sphinx.conf
22-
# import occurs, it will import the *source* version of astropy instead of the
23-
# version installed (if invoked as "make html" or directly with sphinx), or the
24-
# version in the build directory (if "python setup.py build_sphinx" is used).
25-
# Thus, any C-extensions that are needed to build the documentation will *not*
26-
# be accessible, and the documentation will not build correctly.
27-
28-
import os
2+
293
import sys
304
import datetime
31-
from importlib import import_module
5+
from importlib.metadata import version as get_version
6+
from pathlib import Path
7+
328

339
try:
3410
from sphinx_astropy.conf.v1 import * # noqa
3511
except ImportError:
3612
print('ERROR: the documentation requires the sphinx-astropy package to be installed')
3713
sys.exit(1)
3814

39-
# Get configuration information from setup.cfg
40-
from configparser import ConfigParser
41-
conf = ConfigParser()
15+
import tomllib
4216

43-
conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
44-
setup_cfg = dict(conf.items('metadata'))
17+
# Grab minversion from pyproject.toml
18+
with (Path(__file__).parents[1] / "pyproject.toml").open("rb") as f:
19+
pyproject = tomllib.load(f)
20+
21+
__minimum_python_version__ = pyproject["project"]["requires-python"].replace(">=", "")
4522

4623
# -- General configuration ----------------------------------------------------
4724

@@ -76,22 +53,16 @@
7653
# -- Project information ------------------------------------------------------
7754

7855
# This does not *have* to match the package name, but typically does
79-
project = setup_cfg['name']
80-
author = setup_cfg['author']
81-
copyright = '{0}, {1}'.format(
82-
datetime.datetime.now().year, setup_cfg['author'])
56+
project = pyproject["project"]["name"]
57+
author = ", ".join(v["name"] for v in pyproject["project"]["authors"])
58+
copyright = f"{datetime.datetime.now().year}, {author}"
8359

8460
# The version info for the project you're documenting, acts as replacement for
8561
# |version| and |release|, also used in various other places throughout the
8662
# built documents.
87-
88-
import_module(setup_cfg['name'])
89-
package = sys.modules[setup_cfg['name']]
90-
91-
# The short X.Y version.
92-
version = package.__version__.split('-', 1)[0]
93-
# The full version, including alpha/beta/rc tags.
94-
release = package.__version__
63+
release: str = get_version("marxs")
64+
# for example take major/minor
65+
version: str = ".".join(release.split(".")[:2])
9566

9667

9768
# -- Options for HTML output --------------------------------------------------
@@ -163,22 +134,8 @@
163134
man_pages = [('index', project.lower(), project + u' Documentation',
164135
[author], 1)]
165136

166-
167-
# -- Options for the edit_on_github extension ---------------------------------
168-
169-
if setup_cfg.get('edit_on_github').lower() == 'true':
170-
171-
extensions += ['sphinx_astropy.ext.edit_on_github']
172-
173-
edit_on_github_project = setup_cfg['github_project']
174-
edit_on_github_branch = "master"
175-
176-
edit_on_github_source_root = ""
177-
edit_on_github_doc_root = "docs"
178-
edit_on_github_skip_regex = '_.*|api/.*'
179-
180137
# -- Resolving issue number to links in changelog -----------------------------
181-
github_issues_url = 'https://github.com/{0}/issues/'.format(setup_cfg['github_project'])
138+
github_issues_url = pyproject["project"]["urls"]["Issues"]
182139

183140

184141
# -- Options for linkcheck output -------------------------------------------

docs/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ an instrument team. The following section is aimed at instrument teams and propo
6161
support
6262
changelog
6363
credits
64-
licenses
6564

6665

6766
Indices and tables

docs/install.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ git or Astropy yet, please have a look at the
6565
`classic marx`_ C code
6666
======================
6767
The `classic marx`_ code is an optional dependency. By default, it is not used and all
68-
modules build on `classic marx`_ will be unavailable.
68+
modules build on `classic marx`_ will be unavailable. This code is currently compatible with
69+
marx version >= 6.0.
6970

7071
In order to build the interface to the `classic marx`_ C code, you need to set the path
7172
to the `classic marx`_ source code *and* an installed version of `classic marx`_ on your

docs/licenses.rst

Lines changed: 0 additions & 16 deletions
This file was deleted.

docs/requirements.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

licenses/BSD_LICENSE.rst

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)