|
3 | 3 | https://packaging.python.org/en/latest/distributing.html |
4 | 4 | https://github.com/pypa/sampleproject |
5 | 5 | """ |
6 | | -from six import raise_from |
7 | 6 | from os import path |
8 | | - |
| 7 | +import pkg_resources |
9 | 8 | from setuptools import setup, find_packages |
10 | 9 |
|
11 | | -here = path.abspath(path.dirname(__file__)) |
| 10 | +pkg_resources.require("setuptools>=39.2") |
| 11 | +pkg_resources.require("setuptools_scm") |
| 12 | + |
| 13 | +from setuptools_scm import get_version # noqa: E402 |
12 | 14 |
|
13 | 15 | # *************** Dependencies ********* |
14 | 16 | INSTALL_REQUIRES = ['makefun', 'six', 'future;python_version<"3.3"', 'funcsigs;python_version<"3.3"', 'decopatch', |
15 | 17 | 'functools32;python_version<"3.2"'] # 'typing_inspect' is now copied internally so as to be compliant with very old versions of typing module |
16 | 18 | DEPENDENCY_LINKS = [] |
17 | | -SETUP_REQUIRES = ['pytest-runner', 'setuptools_scm', 'enum34;python_version<"3.4"', 'six'] |
| 19 | +SETUP_REQUIRES = ['pytest-runner', 'setuptools_scm', 'enum34;python_version<"3.4"'] |
18 | 20 | TESTS_REQUIRE = ['pytest>=4.4.0', 'pytest-logging', 'enforce', 'mini_lambda', 'attrs', 'numpy', |
19 | 21 | 'autoclass', 'checktypes', 'pytest-cases'] |
20 | 22 | EXTRAS_REQUIRE = {} |
21 | 23 |
|
22 | | -# simple check |
23 | | -try: |
24 | | - from setuptools_scm import get_version |
25 | | -except Exception as e: |
26 | | - raise_from(Exception('Required packages for setup not found. Please install `setuptools_scm`'), e) |
27 | | - |
28 | 24 | # ************** ID card ***************** |
29 | 25 | DISTNAME = 'valid8' |
30 | 26 | DESCRIPTION = 'Yet another validation lib ;). Provides tools for general-purpose variable validation, ' \ |
|
34 | 30 | MAINTAINER = 'Sylvain Marié' |
35 | 31 | MAINTAINER_EMAIL = '[email protected]' |
36 | 32 | URL = 'https://github.com/smarie/python-valid8' |
| 33 | +DOWNLOAD_URL = URL + '/tarball/' + get_version() |
37 | 34 | LICENSE = 'BSD 3-Clause' |
38 | 35 | LICENSE_LONG = 'License :: OSI Approved :: BSD License' |
39 | | - |
40 | | -version_for_download_url = get_version() |
41 | | -DOWNLOAD_URL = URL + '/tarball/' + version_for_download_url |
42 | | - |
43 | 36 | KEYWORDS = 'decorate decorator input arg args argument function contract value check checker valid validate validator' \ |
44 | 37 | ' validation' |
45 | 38 |
|
| 39 | +here = path.abspath(path.dirname(__file__)) |
46 | 40 | with open(path.join(here, 'docs', 'long_description.md')) as f: |
47 | 41 | LONG_DESCRIPTION = f.read() |
48 | 42 |
|
49 | | -# ************* VERSION ************** |
50 | | -# --Get the Version number from VERSION file, see https://packaging.python.org/single_source_version/ option 4. |
51 | | -# THIS IS DEPRECATED AS WE NOW USE GIT TO MANAGE VERSION |
52 | | -# with open(path.join(here, 'VERSION')) as version_file: |
53 | | -# VERSION = version_file.read().strip() |
54 | 43 | # OBSOLETES = [] |
55 | 44 |
|
56 | 45 | setup( |
|
96 | 85 | # 'Programming Language :: Python :: 3.4', |
97 | 86 | 'Programming Language :: Python :: 3.5', |
98 | 87 | 'Programming Language :: Python :: 3.6', |
99 | | - 'Programming Language :: Python :: 3.7' |
| 88 | + 'Programming Language :: Python :: 3.7', |
| 89 | + |
| 90 | + # 'Framework :: Pytest' |
100 | 91 | ], |
101 | 92 |
|
102 | 93 | # What does your project relate to? |
103 | 94 | keywords=KEYWORDS, |
104 | 95 |
|
105 | 96 | # You can just specify the packages manually here if your project is |
106 | 97 | # simple. Or you can use find_packages(). |
107 | | - packages=find_packages(exclude=['contrib', 'docs', 'tests']), |
| 98 | + packages=find_packages(exclude=['contrib', 'docs', '*tests*']), |
108 | 99 |
|
109 | 100 | # Alternatively, if you want to distribute just a my_module.py, uncomment |
110 | 101 | # this: |
|
139 | 130 | # have to be included in MANIFEST.in as well. |
140 | 131 | # Note: we use the empty string so that this also works with submodules |
141 | 132 | package_data={"": ['py.typed', '*.pyi']}, |
| 133 | + # IMPORTANT: DO NOT set the `include_package_data` flag !! It triggers inclusion of all git-versioned files |
| 134 | + # see https://github.com/pypa/setuptools_scm/issues/190#issuecomment-351181286 |
| 135 | + # include_package_data=True, |
142 | 136 |
|
143 | 137 | # Although 'package_data' is the preferred approach, in some case you may |
144 | 138 | # need to place data files outside of your packages. See: |
|
0 commit comments