|
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 = ['decopatch', 'funcsigs;python_version<"3.3"', 'makefun'] |
15 | 17 | DEPENDENCY_LINKS = [] |
16 | | -SETUP_REQUIRES = ['pytest-runner', 'setuptools_scm', 'pypandoc', 'pandoc'] |
17 | | -TESTS_REQUIRE = ['pytest', 'pytest-logging', 'PyContracts', 'enforce', 'pytypes', 'pyfields', 'valid8'] |
| 18 | +SETUP_REQUIRES = ['pytest-runner', 'setuptools_scm'] |
| 19 | +TESTS_REQUIRE = ['pytest', 'PyContracts', 'enforce', 'pytypes', 'pyfields', 'valid8'] |
18 | 20 | EXTRAS_REQUIRE = {'contracts': ['PyContracts'], |
19 | 21 | 'enforce': ['enforce'], |
20 | 22 | 'validate': ['valid8']} |
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 = 'autoclass' |
30 | 26 | DESCRIPTION = 'Helps you write compact python classes' |
31 | 27 | MAINTAINER = 'Sylvain MARIE' |
32 | 28 | MAINTAINER_EMAIL = 'sylvain.marie@se.com' |
33 | 29 | URL = 'https://github.com/smarie/python-autoclass' |
| 30 | +DOWNLOAD_URL = URL + '/tarball/' + get_version() |
34 | 31 | LICENSE = 'BSD 3-Clause' |
35 | 32 | LICENSE_LONG = 'License :: OSI Approved :: BSD License' |
36 | | - |
37 | | -version_for_download_url = get_version() |
38 | | -DOWNLOAD_URL = URL + '/tarball/' + version_for_download_url |
39 | | - |
40 | 33 | KEYWORDS = 'auto code generator getter setter constructor autoarg autoprops decorator property properties fields ' \ |
41 | 34 | 'attribute attr contract object class enforce valid boilerplate pep484 type-hints runtime-typechecking ' \ |
42 | 35 | 'typechecking' |
43 | 36 |
|
| 37 | +here = path.abspath(path.dirname(__file__)) |
44 | 38 | with open(path.join(here, 'docs', 'long_description.md')) as f: |
45 | 39 | LONG_DESCRIPTION = f.read() |
46 | 40 |
|
47 | | -# ************* VERSION ************** |
48 | | -# --Get the Version number from VERSION file, see https://packaging.python.org/single_source_version/ option 4. |
49 | | -# THIS IS DEPRECATED AS WE NOW USE GIT TO MANAGE VERSION |
50 | | -# with open(path.join(here, 'VERSION')) as version_file: |
51 | | -# VERSION = version_file.read().strip() |
52 | 41 | OBSOLETES = ['classtools_autocode'] |
53 | 42 |
|
54 | 43 | setup( |
|
0 commit comments