Skip to content

Commit 860f392

Browse files
author
Sylvain MARIE
committed
setup improvements: set the universal flag to 1, and cleaned up the setup.py. Fixes #36
1 parent af4ebc1 commit 860f392

File tree

2 files changed

+10
-21
lines changed

2 files changed

+10
-21
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# This flag says that the code is written to work on both Python 2 and Python
88
# 3. If at all possible, it is good practice to do this. If you cannot, you
99
# will need to generate wheels for each Python version that you support.
10-
universal=0
10+
universal=1
1111

1212
[metadata]
1313
description-file = README.md

setup.py

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,41 @@
33
https://packaging.python.org/en/latest/distributing.html
44
https://github.com/pypa/sampleproject
55
"""
6-
from six import raise_from
76
from os import path
8-
7+
import pkg_resources
98
from setuptools import setup, find_packages
109

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
1214

1315
# *************** Dependencies *********
1416
INSTALL_REQUIRES = ['decopatch', 'funcsigs;python_version<"3.3"', 'makefun']
1517
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']
1820
EXTRAS_REQUIRE = {'contracts': ['PyContracts'],
1921
'enforce': ['enforce'],
2022
'validate': ['valid8']}
2123

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-
2824
# ************** ID card *****************
2925
DISTNAME = 'autoclass'
3026
DESCRIPTION = 'Helps you write compact python classes'
3127
MAINTAINER = 'Sylvain MARIE'
3228
MAINTAINER_EMAIL = '[email protected]'
3329
URL = 'https://github.com/smarie/python-autoclass'
30+
DOWNLOAD_URL = URL + '/tarball/' + get_version()
3431
LICENSE = 'BSD 3-Clause'
3532
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-
4033
KEYWORDS = 'auto code generator getter setter constructor autoarg autoprops decorator property properties fields ' \
4134
'attribute attr contract object class enforce valid boilerplate pep484 type-hints runtime-typechecking ' \
4235
'typechecking'
4336

37+
here = path.abspath(path.dirname(__file__))
4438
with open(path.join(here, 'docs', 'long_description.md')) as f:
4539
LONG_DESCRIPTION = f.read()
4640

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()
5241
OBSOLETES = ['classtools_autocode']
5342

5443
setup(

0 commit comments

Comments
 (0)