Skip to content

Commit

Permalink
Merge pull request #72 from karllark/update_tox_2023
Browse files Browse the repository at this point in the history
Update 2023, codecov failing - can't activate on codecov site, will intestigate.
  • Loading branch information
karllark committed Nov 28, 2023
2 parents b6b9efb + 9a492ca commit 84f8eb6
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 125 deletions.
53 changes: 28 additions & 25 deletions .github/workflows/tox-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ jobs:
# Github actions supports ubuntu, windows, and macos virtual environments:
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
#
os: [ubuntu-latest, macos-latest, windows-latest]
# Only run on ubuntu by default, but can add other os's to the test matrix here.
# For example -- os: [ubuntu-latest, macos-latest, windows-latest]
# windows-latest not possible due to how temp files are used in tests currently
os: [ubuntu-latest, macos-latest]

# Test python 3.7, and 3.8 by default.
python-ver: [7, 8, 9, 10]
# Test python version 3.x
python-ver: [9, 10, 11]

# Specify which tox environments to test in this list.
# tox-env: [cov, alldeps, devdeps, astropylts]
Expand All @@ -46,22 +49,22 @@ jobs:
tox -e py3${{ matrix.python-ver }}-${{ matrix.tox-env }}
# Dev version test
dev_test:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v1
- name: Set up python for astropy, numpy dev test
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Test with tox
run: |
tox -e py38-devdeps
# dev_test:
# runs-on: ubuntu-latest
# if: "!contains(github.event.head_commit.message, '[ci skip]')"
# steps:
# - uses: actions/checkout@v1
# - name: Set up python for astropy, numpy dev test
# uses: actions/setup-python@v1
# with:
# python-version: 3.8
# - name: Install base dependencies
# run: |
# python -m pip install --upgrade pip
# python -m pip install tox
# - name: Test with tox
# run: |
# tox -e py38-devdeps

# LTS version test
lts_test:
Expand All @@ -72,14 +75,14 @@ jobs:
- name: Set up python for astropy lts test
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.9
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Test with tox
run: |
tox -e py38-astropylts
tox -e py39-astropylts
# Coverage test
cov_test:
Expand All @@ -90,14 +93,14 @@ jobs:
- name: Set up python for coverage test
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.11
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Test with tox
run: |
tox -e py38-cov
tox -e py311-cov
- name: Upload coverage to codecov
uses: codecov/codecov-action@v1
with:
Expand All @@ -120,7 +123,7 @@ jobs:
- name: Set up Python to build docs with sphinx
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.11
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -140,7 +143,7 @@ jobs:
- name: Python codestyle check
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.11
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
Expand Down
18 changes: 18 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.12"

python:
install:
- method: pip
path: .
extra_requirements:
- docs
- all

# Don't build any extra formats
formats: []

6 changes: 1 addition & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ Build checks/status
:target: https://codecov.io/gh/BEAST-Fitting/megabeast
:alt: Test Coverage Status

.. image:: https://img.shields.io/lgtm/grade/python/g/BEAST-Fitting/megabeast.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/BEAST-Fitting/megabeast/context:python
:alt: LGTM language grade: Python

.. image:: https://api.codacy.com/project/badge/Grade/584c9ed581c6457381d01a4e86e08916
:target: https://www.codacy.com/manual/kgordon/megabeast?utm_source=github.com&utm_medium=referral&utm_content=karllark/megabeast&utm_campaign=Badge_Grade
:alt: Codacy Badge
Expand Down Expand Up @@ -81,5 +77,5 @@ more information.

.. _AstroPy: http://www.astropy.org/
.. _contributing: http://docs.astropy.org/en/stable/index.html#contributing
.. _developer: http://docs.astropy.org/en/stable/index.html#developer-documentation
.. _developer: https://docs.astropy.org/en/stable/index_dev.html
.. _Astropy Code of Conduct: http://www.astropy.org/about.html#codeofconduct
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fixes, code, or documentation (no git or GitHub experience necessary):

* `Coding Guidelines <https://docs.astropy.org/en/stable/development/codeguide.html>`_

* `Developer Documentation <https://docs.astropy.org/en/stable/#developer-documentation>`_
* `Developer Documentation <https://docs.astropy.org/en/stable/index_dev.html>`_


For the complete list of contributors please see the `megabeast
Expand Down
13 changes: 5 additions & 8 deletions megabeast/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from importlib.metadata import version as _version, PackageNotFoundError

# Packages may add whatever they like to this file, but
# should keep this content at the top.
# ----------------------------------------------------------------------------
from ._astropy_init import * # noqa
# ----------------------------------------------------------------------------

__all__ = []
try:
__version__ = _version(__name__)
except PackageNotFoundError: # pragma: no cover
pass
52 changes: 0 additions & 52 deletions megabeast/_astropy_init.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from astropy.io import fits

from beast.tools.read_beast_data import read_sed_data, read_lnp_data
from beast.physicsmodel.prior_weights_dust import _lognorm, _two_lognorm
from beast.physicsmodel.priormodel_functions import _lognorm, _two_lognorm

from megabeast.read_input import read_input

Expand Down
7 changes: 7 additions & 0 deletions megabeast/tests/basic_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from megabeast.mbsettings import mbsettings


def test_basic():
mbparams = mbsettings()

assert isinstance(mbparams, mbsettings)
2 changes: 1 addition & 1 deletion megabeast/tools/make_naive_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def create_naive_maps(stats_filename, pix_size=10.0, verbose=False):
stat_type = "Exp"

# read in the full brick catalog
if type(stats_filename) == str:
if isinstance(stats_filename, str):
stats_filename = [stats_filename]
cat = Table.read(stats_filename[0])
if len(stats_filename) > 1:
Expand Down
9 changes: 0 additions & 9 deletions readthedocs.yml

This file was deleted.

3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ github_project = BEAST-Fitting/megabeast
[options]
zip_safe = False
packages = find:
python_requires = >=3.6
python_requires = >=3.9
setup_requires = setuptools_scm
install_requires =
scipy
Expand Down Expand Up @@ -55,6 +55,7 @@ omit =
megabeast/*/tests/*
megabeast/extern/*
megabeast/version*
megabeast/old/*
*/megabeast/_astropy_init*
*/megabeast/conftest.py
*/megabeast/*setup_package*
Expand Down
25 changes: 3 additions & 22 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
[tox]
envlist =
py{37,38,39,310}-test{,-alldeps,-devdeps}{,-cov}
py{37,38,39,310}-test-numpy{118,119,120,121}
py{37,38,39,310}-test-astropy{40,50}
py{39,310,311}-test{,-alldeps}{,-cov}
build_docs
linkcheck
codestyle
requires =
setuptools >= 30.3.0
pip >= 19.3.1
isolated_build = true
indexserver =
NIGHTLY = https://pypi.anaconda.org/scipy-wheels-nightly/simple

[testenv]
# Suppress display of matplotlib plots generated during docs build
setenv = MPLBACKEND=agg

# Pass through the following environment variables which may be needed for the CI
passenv = HOME WINDIR LC_ALL LC_CTYPE CC CI TRAVIS
passenv = HOME, WINDIR, LC_ALL, LC_CTYPE, CC, CI, TRAVIS

# Run the tests in a temporary directory to make sure that we don't import
# this package from the source tree
Expand All @@ -38,28 +34,13 @@ description =
devdeps: with the latest developer version of key dependencies
oldestdeps: with the oldest supported version of key dependencies
cov: and test coverage
numpy118: with numpy 1.18.*
numpy119: with numpy 1.19.*
numpy120: with numpy 1.20.*
numpy121: with numpy 1.21.*
astropy40: with astropy 4.0.*
astropy50: with astropy 5.0.*
astropylts: with the latest astropy LTS (currently v5.0)

# The following provides some specific pinnings for key packages
deps =

numpy118: numpy==1.18.*
numpy119: numpy==1.19.*
numpy120: numpy==1.20.*
numpy121: numpy==1.21.*

astropy40: astropy==4.0.*
astropy50: astropy==5.0.*
astropylts: astropy==5.0.*

devdeps: :NIGHTLY:numpy
devdeps: git+https://github.com/astropy/astropy.git#egg=astropy
devdeps: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scipy-wheels-nightly/simple

# The following indicates which extras_require from setup.cfg will be installed
extras =
Expand Down

0 comments on commit 84f8eb6

Please sign in to comment.