Skip to content

Commit

Permalink
Merge pull request #24 from Johannes-Sahlmann/Johannes-Sahlmann-patch-1
Browse files Browse the repository at this point in the history
Make package compatible with astropy >= 6.0
Add python-package-conda.yml for actions
Add test pipelines
  • Loading branch information
Johannes-Sahlmann authored Sep 27, 2024
2 parents 355a87d + 9a3ac68 commit 619599d
Show file tree
Hide file tree
Showing 13 changed files with 191 additions and 157 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Python Package using Conda

on: [push]

jobs:
build-linux-python-3p10:
runs-on: ubuntu-latest
strategy:
max-parallel: 5

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Add conda to system path
run: |
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
conda env update --file environment-3.10.yml --name base
- name: Lint with flake8
run: |
conda install flake8
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
continue-on-error: true
- name: Test with pytest
run: |
conda config --set solver classic
conda install pytest
pytest pystrometry/tests
build-linux-python-3p10-pinned:
runs-on: ubuntu-latest
strategy:
max-parallel: 5

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Add conda to system path
run: |
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
conda env update --file environment-3.10-pinned.yml --name base
- name: Lint with flake8
run: |
conda install flake8
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
continue-on-error: true
- name: Test with pytest
run: |
conda config --set solver classic
conda install pytest
pytest pystrometry/tests
build-linux-python-3p9:
runs-on: ubuntu-latest
strategy:
max-parallel: 5

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Add conda to system path
run: |
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
conda env update --file environment-3.9.yml --name base
- name: Lint with flake8
run: |
conda install flake8
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
continue-on-error: true
- name: Test with pytest
run: |
conda install pytest
pytest pystrometry/tests
17 changes: 17 additions & 0 deletions environment-3.10-pinned.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: pystrometry-environment
channels:
- conda-forge
dependencies:
- python == 3.10
- numpy == 1.24.3
- pip == 23.1.2
- kepmodel == 1.0.6
- pandas == 2.0.2
- matplotlib == 3.7.1
- astroquery == 0.4.6
- astropy == 5.0.6
- sympy
- scipy
- uncertainties
- pip:
- linearfit
17 changes: 17 additions & 0 deletions environment-3.10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: pystrometry-environment-3p10
channels:
- conda-forge
dependencies:
- python == 3.10
- numpy
- pip
- kepmodel
- pandas
- matplotlib
- astroquery
- astropy
- sympy
- scipy
- uncertainties
- pip:
- linearfit
17 changes: 17 additions & 0 deletions environment-3.11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: pystrometry-environment
channels:
- conda-forge
dependencies:
- python == 3.11
- numpy
- pip
- kepmodel
- pandas
- matplotlib
- astroquery
- astropy
- sympy
- scipy
- uncertainties
- pip:
- linearfit
17 changes: 17 additions & 0 deletions environment-3.9-pinned.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: pystrometry-environment
channels:
- conda-forge
dependencies:
- python == 3.9
- numpy == 1.24.3
- pip == 23.1.2
- kepmodel == 1.0.6
- pandas == 2.0.2
- matplotlib == 3.7.1
- astroquery == 0.4.6
- astropy == 5.0.6
- sympy
- scipy
- uncertainties
- pip:
- linearfit
17 changes: 17 additions & 0 deletions environment-3.9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: pystrometry-environment
channels:
- conda-forge
dependencies:
- python == 3.9
- numpy
- pip
- kepmodel
- pandas
- matplotlib
- astroquery
- astropy
- sympy
- scipy
- uncertainties
- pip:
- linearfit
6 changes: 3 additions & 3 deletions pystrometry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ class UnsupportedPythonError(Exception):
if sys.version_info < tuple((int(val) for val in __minimum_python_version__.split('.'))):
raise UnsupportedPythonError("pystrometry does not support Python < {}".format(__minimum_python_version__))

if not _ASTROPY_SETUP_:
# For egg_info test builds to pass, put package imports here.
from .example_mod import *
# if not _ASTROPY_SETUP_:
# # For egg_info test builds to pass, put package imports here.
# from .example_mod import *
14 changes: 10 additions & 4 deletions pystrometry/_astropy_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@
if not _ASTROPY_SETUP_: # noqa
import os
from warnings import warn
from astropy.config.configuration import (
update_default_config,
ConfigurationDefaultMissingError,
ConfigurationDefaultMissingWarning)

try:
from astropy.config.configuration import (
update_default_config,
ConfigurationDefaultMissingError,
ConfigurationDefaultMissingWarning)
except ImportError:
# Handle the case where update_default_config is not available
# update_default_config = None
pass

# Create the test function for self test
from astropy.tests.runner import TestRunner
Expand Down
57 changes: 0 additions & 57 deletions pystrometry/conftest.py

This file was deleted.

77 changes: 0 additions & 77 deletions pystrometry/example_mod.py

This file was deleted.

14 changes: 0 additions & 14 deletions pystrometry/tests/test_example.py

This file was deleted.

2 changes: 1 addition & 1 deletion readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
conda:
file: .rtd-environment.yml
file: .rtd-environment-3.9-pinned.yml

python:
setup_py_install: true
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ github_project = https://github.com/Johannes-Sahlmann/pystrometry
install_requires = astropy, linearfit>=1.0.2, matplotlib, scipy, astroquery, sympy

# version should be PEP440 compatible (https://www.python.org/dev/peps/pep-0440/)
version = 0.5.0
version = 0.6.0
# Note: you will also need to change this in your package's __init__.py
minimum_python_version = 3.7

Expand Down

0 comments on commit 619599d

Please sign in to comment.