Skip to content

Updated package infrastructure #24

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

Merged
merged 8 commits into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 51 additions & 83 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,95 +1,63 @@
# Created by .ignore support plugin (hsz.mobi)
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
# Compiled files
*.py[cod]
*$py.class

# C extensions
*.a
*.o
*.so
*.pyd
__pycache__

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
# Ignore .c files by default to avoid including generated code. If you want to
# add a non-generated .c extension, use `git add -f filename.c`.
*.c

# Flask stuff:
instance/
.webassets-cache
# Other generated files
MANIFEST

# Scrapy stuff:
.scrapy
# Sphinx
_build
_generated
docs/api
docs/generated

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version
# Packages/installer info
*.egg
*.egg-info
dist
build
eggs
.eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
distribute-*.tar.gz

# celery beat schedule file
celerybeat-schedule
# Other
.cache
.tox
.*.swp
.*.swo
*~
.project
.pydevproject
.settings
.coverage
cover
htmlcov
.pytest_cache

# dotenv
# Env
.venv
venv
.env

# virtualenv
.venv/
venv/
ENV/

# Spyder project settings
.spyderproject
# Mac OSX
.DS_Store

# Rope project settings
.ropeproject

# PyCharm project settings
# PyCharm
.idea

*/version.py
pip-wheel-metadata/
78 changes: 57 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# We set the language to c because python isn't supported on the MacOS X nodes
# on Travis. However, the language ends up being irrelevant anyway, since we
# install Python ourselves using conda.
language: c

os:
- linux

# Use Travis' container-based architecture
sudo: false

notifications:
Expand All @@ -10,29 +17,58 @@ notifications:
if: type = cron

env:
global:
- CONDA_DEPENDENCIES="pytest pytest-cov numpy astropy"
- PIP_DEPENDENCIES="codecov"
matrix:
- PYTHON_VERSION=2.7
- PYTHON_VERSION=3.5
- PYTHON_VERSION=3.6
global:
# The following versions are the 'default' for tests, unless
# overidden underneath. They are defined here in order to save having
# to repeat them for all configurations.
- TOXENV='test'
- TOXARGS='-v'
- TOXPOSARGS=''

install:
- git clone git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh
matrix:
include:

# Make sure pytest-arraydiff wasn't installed by conda
- conda remove pytest-arraydiff --force || true
- language: python
python: 3.6
name: Python 3.6 and pytest 4.6 (Linux)
env: TOXENV=py36-test-pytest46

# Need to use develop instead of install to make sure coverage works
- pip install -e .
- os: windows
name: Python 3.6 and pytest 5.0 (Windows)
env: PYTHON_VERSION=3.6
TOXENV=py36-test-pytest50

script:
- python -c 'import pytest_arraydiff.plugin'
- pytest -vv --arraydiff --cov pytest_arraydiff tests
- pytest -vv --cov pytest_arraydiff --cov-append tests
- python setup.py check --restructuredtext
- os: osx
name: Python 3.7 and pytest 5.1 (MacOS X)
env: PYTHON_VERSION=3.7
TOXENV=py37-test-pytest51

- language: python
python: 3.7
name: Python 3.7 and pytest 5.2 (Linux)
env: TOXENV=py37-test-pytest52

- os: windows
name: Python 3.8 and pytest 5.3 (Windows)
env: PYTHON_VERSION=3.8
TOXENV=py38-test-pytest53

after_success:
- codecov
- language: python
python: 3.8
name: Python 3.8 and pytest 6.0 (Linux)
env: TOXENV=py38-test-pytest60

- os: osx
name: Python 3.8 and pytest dev (MacOS X)
env: PYTHON_VERSION=3.8
TOXENV=py38-test-pytestdev

install:
- if [[ $TRAVIS_OS_NAME == osx || $TRAVIS_OS_NAME == windows ]]; then
git clone git://github.com/astropy/ci-helpers.git;
source ci-helpers/travis/setup_python.sh;
fi

script:
- pip install tox
- tox $TOXARGS -- $TOXPOSARGS
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ include LICENSE
include README.rst
include CHANGES.md
include tox.ini
include pyproject.toml
include setup.cfg
include setup.py

recursive-include tests *.py *.fits *.txt
32 changes: 0 additions & 32 deletions appveyor.yml

This file was deleted.

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
requires = ["setuptools>=30.3.0",
"setuptools_scm",
"wheel"]
build-backend = 'setuptools.build_meta'
4 changes: 3 additions & 1 deletion pytest_arraydiff/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = '0.4.dev0'
# Licensed under a 3-clause BSD style license - see LICENSE.rst

from .version import version as __version__ # noqa
6 changes: 1 addition & 5 deletions pytest_arraydiff/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import shutil
import tempfile
import warnings
from distutils.version import StrictVersion

import six
from six.moves.urllib.request import urlopen
Expand Down Expand Up @@ -213,10 +212,7 @@ def __init__(self, config, reference_dir=None, generate_dir=None, default_format

def pytest_runtest_setup(self, item):

if StrictVersion(pytest.__version__) < StrictVersion("3.6"):
compare = item.get_marker('array_compare')
else:
compare = item.get_closest_marker('array_compare')
compare = item.get_closest_marker('array_compare')

if compare is None:
return
Expand Down
48 changes: 48 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[metadata]
name = pytest-arraydiff
url = https://github.com/astrofrog/pytest-arraydiff
author = The Astropy Developers
author_email = [email protected]
classifiers =
Development Status :: 4 - Beta
Framework :: Pytest
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: Implementation :: CPython
Topic :: Software Development :: Testing
Topic :: Utilities
license = BSD
description = pytest plugin to help with comparing array output from tests
long_description = file: README.rst

[options]
zip_safe = False
packages = find:
python_requires = >=3.6
setup_requires =
setuptools_scm
install_requires =
pytest>=4.6
numpy
astropy

[options.entry_points]
pytest11 =
pytest_arraydiff = pytest_arraydiff.plugin

[tool:pytest]
minversion = 4.6
testpaths = tests
xfail_strict = true
markers =
array_compare : for functions using array comparison

[flake8]
max-line-length = 100
Loading