Skip to content

Commit

Permalink
Added __version__ package-level attribute.
Browse files Browse the repository at this point in the history
Removed pypandoc dependency
Got rid of pytest-cov
Fixed pytest-html version
  • Loading branch information
Sylvain MARIE committed Oct 1, 2019
1 parent 0f0393f commit 88d45b4
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 24 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ matrix:
- python: 2.7
env: PYTEST_VERSION="<3" PYTEST_HTML_VERSION="==1.9.0" # indeed recent pytest_html require pytest>=3
- python: 2.7
env: PYTEST_VERSION="<4" PYTEST_HTML_VERSION=""
env: PYTEST_VERSION="<4" PYTEST_HTML_VERSION="==1.9.0"
- python: 3.5
env: PYTEST_VERSION="<3" PYTEST_HTML_VERSION="==1.9.0" # indeed recent pytest_html require pytest>=3
- python: 3.5
env: PYTEST_VERSION="<4" PYTEST_HTML_VERSION=""
env: PYTEST_VERSION="<4" PYTEST_HTML_VERSION="==1.9.0"
- python: 3.6
env: PYTEST_VERSION="<3" PYTEST_HTML_VERSION="==1.9.0" # indeed recent pytest_html require pytest>=3
- python: 3.6
env: PYTEST_VERSION="<4" PYTEST_HTML_VERSION=""
env: PYTEST_VERSION="<4" PYTEST_HTML_VERSION="==1.9.0"
- python: 3.7
env: PYTEST_VERSION="<3" PYTEST_HTML_VERSION="==1.9.0" # indeed recent pytest_html require pytest>=3
dist: xenial
sudo: true
- python: 3.7
env: PYTEST_VERSION="<4" PYTEST_HTML_VERSION=""
env: PYTEST_VERSION="<4" PYTEST_HTML_VERSION="==1.9.0"
dist: xenial
sudo: true

Expand Down
1 change: 0 additions & 1 deletion ci_tools/requirements-conda.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# --- to execute setup.py whatever the goal
# pytest-runner
pandoc

# --- to install
# wrapt
Expand Down
1 change: 0 additions & 1 deletion ci_tools/requirements-pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
setuptools_scm
six
pytest-runner
pypandoc

# --- to install
makefun>=1.5
Expand Down
4 changes: 2 additions & 2 deletions ci_tools/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ trap "cleanup" INT TERM EXIT
#fi

if [ "${TRAVIS_PYTHON_VERSION}" = "3.5" ]; then
# full
# First the raw for coverage
# full
# First the raw for coverage
echo -e "\n\n****** Running tests : 1/2 RAW******\n\n"
coverage run --source pytest_steps -m pytest -v pytest_steps/tests_raw/
# python -m pytest --cov-report term-missing --cov=./pytest_steps -v pytest_steps/tests_raw/
Expand Down
12 changes: 12 additions & 0 deletions pytest_steps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@
from pytest_steps.steps_generator import optional_step, one_fixture_per_step
from pytest_steps.steps_parametrizer import StepsDataHolder, depends_on

try:
# -- Distribution mode --
# import from _version.py generated by setuptools_scm during release
from ._version import version as __version__
except ImportError:
# -- Source mode --
# use setuptools_scm to get the current version from src using git
from setuptools_scm import get_version as _gv
from os import path as _path
__version__ = _gv(_path.join(_path.dirname(__file__), _path.pardir))

__all__ = [
'__version__',
# the submodules
'steps', 'steps_generator', 'steps_parametrizer', 'steps_harvest',
'steps_harvest_df_utils',
Expand Down
25 changes: 9 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# *************** Dependencies *********
INSTALL_REQUIRES = ['makefun>=1.5', 'wrapt', 'functools32;python_version<"3.2"', 'funcsigs;python_version<"3.3"', 'six']
DEPENDENCY_LINKS = []
SETUP_REQUIRES = ['pytest-runner', 'setuptools_scm', 'pypandoc', 'pandoc', 'six']
TESTS_REQUIRE = ['pytest', 'pytest-logging', 'pytest-cov', 'pytest-harvest>=1.4.0', 'pytest-cases']
SETUP_REQUIRES = ['pytest-runner', 'setuptools_scm', 'six']
TESTS_REQUIRE = ['pytest', 'pytest-logging', 'pytest-harvest>=1.4.0', 'pytest-cases']
EXTRAS_REQUIRE = {}

# simple check
Expand All @@ -36,19 +36,11 @@
DOWNLOAD_URL = URL + '/tarball/' + version_for_download_url

KEYWORDS = 'pytest test step incremental decorator parametrize parameter state share result modular'
# --Get the long description from the README file
# with open(path.join(here, 'README.md'), encoding='utf-8') as f:
# LONG_DESCRIPTION = f.read()
try:
import pypandoc
LONG_DESCRIPTION = pypandoc.convert(path.join(here, 'docs', 'long_description.md'), 'rst').replace('\r', '')
except(ImportError):
from warnings import warn
warn('WARNING pypandoc could not be imported - we recommend that you install it in order to package the '
'documentation correctly')
LONG_DESCRIPTION = open('README.md').read()

# ************* VERSION A **************

with open(path.join(here, 'docs', 'long_description.md')) as f:
LONG_DESCRIPTION = f.read()

# ************* VERSION **************
# --Get the Version number from VERSION file, see https://packaging.python.org/single_source_version/ option 4.
# THIS IS DEPRECATED AS WE NOW USE GIT TO MANAGE VERSION
# with open(path.join(here, 'VERSION')) as version_file:
Expand All @@ -59,6 +51,7 @@
name=DISTNAME,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',

# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
Expand Down Expand Up @@ -121,7 +114,7 @@
dependency_links=DEPENDENCY_LINKS,

# we're using git
use_scm_version=True, # this provides the version + adds the date if local non-commited changes.
use_scm_version={'write_to': 'pytest_steps/_version.py'}, # this provides the version + adds the date if local non-commited changes.
# use_scm_version={'local_scheme':'dirty-tag'}, # this provides the version + adds '+dirty' if local non-commited changes.
setup_requires=SETUP_REQUIRES,

Expand Down

0 comments on commit 88d45b4

Please sign in to comment.