Skip to content

Commit e3af679

Browse files
author
Sylvain MARIE
committed
Added __version__ package-level attribute.
Removed pypandoc dependency
1 parent 80b3c49 commit e3af679

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

ci_tools/requirements-pip.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
six
33
pytest-runner
44
setuptools_scm
5-
pypandoc
65

76
# -- to install
87
makefun

pytest_cases/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,19 @@
66
from pytest_cases.main_params import cases_data, CaseDataGetter, unfold_expected_err, get_all_cases, THIS_MODULE, \
77
get_pytest_parametrize_args
88

9+
try:
10+
# -- Distribution mode --
11+
# import from _version.py generated by setuptools_scm during release
12+
from ._version import version as __version__
13+
except ImportError:
14+
# -- Source mode --
15+
# use setuptools_scm to get the current version from src using git
16+
from setuptools_scm import get_version as _gv
17+
from os import path as _path
18+
__version__ = _gv(_path.join(_path.dirname(__file__), _path.pardir))
19+
920
__all__ = [
21+
'__version__',
1022
# the submodules
1123
'case_funcs', 'common', 'main_fixtures', 'main_params',
1224
# all symbols imported above

setup.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
INSTALL_REQUIRES = ['wrapt', 'decopatch', 'makefun', 'functools32;python_version<"3.2"',
1515
'funcsigs;python_version<"3.3"', 'enum34;python_version<"3.4"', 'six']
1616
DEPENDENCY_LINKS = []
17-
SETUP_REQUIRES = ['pytest-runner', 'setuptools_scm', 'pypandoc', 'pandoc', 'six']
17+
SETUP_REQUIRES = ['pytest-runner', 'setuptools_scm', 'six']
1818
TESTS_REQUIRE = ['pytest', 'pytest-logging', 'pytest-steps', 'pytest-harvest']
1919
EXTRAS_REQUIRE = {}
2020

@@ -37,19 +37,11 @@
3737
DOWNLOAD_URL = URL + '/tarball/' + version_for_download_url
3838

3939
KEYWORDS = 'pytest test case testcase test-case decorator parametrize parameter data dataset file separate concerns'
40-
# --Get the long description from the README file
41-
# with open(path.join(here, 'README.md'), encoding='utf-8') as f:
42-
# LONG_DESCRIPTION = f.read()
43-
try:
44-
import pypandoc
45-
LONG_DESCRIPTION = pypandoc.convert(path.join(here, 'docs', 'long_description.md'), 'rst').replace('\r', '')
46-
except(ImportError):
47-
from warnings import warn
48-
warn('WARNING pypandoc could not be imported - we recommend that you install it in order to package the '
49-
'documentation correctly')
50-
LONG_DESCRIPTION = open('README.md').read()
51-
52-
# ************* VERSION A **************
40+
41+
with open(path.join(here, 'docs', 'long_description.md')) as f:
42+
LONG_DESCRIPTION = f.read()
43+
44+
# ************* VERSION **************
5345
# --Get the Version number from VERSION file, see https://packaging.python.org/single_source_version/ option 4.
5446
# THIS IS DEPRECATED AS WE NOW USE GIT TO MANAGE VERSION
5547
# with open(path.join(here, 'VERSION')) as version_file:
@@ -60,6 +52,7 @@
6052
name=DISTNAME,
6153
description=DESCRIPTION,
6254
long_description=LONG_DESCRIPTION,
55+
long_description_content_type='text/markdown',
6356

6457
# Versions should comply with PEP440. For a discussion on single-sourcing
6558
# the version across setup.py and the project code, see
@@ -122,7 +115,7 @@
122115
dependency_links=DEPENDENCY_LINKS,
123116

124117
# we're using git
125-
use_scm_version=True, # this provides the version + adds the date if local non-commited changes.
118+
use_scm_version={'write_to': '%s/_version.py' % DISTNAME}, # this provides the version + adds the date if local non-commited changes.
126119
# use_scm_version={'local_scheme':'dirty-tag'}, # this provides the version + adds '+dirty' if local non-commited changes.
127120
setup_requires=SETUP_REQUIRES,
128121

0 commit comments

Comments
 (0)