Skip to content

Commit f38d1ca

Browse files
committed
"python setup.py sdist bdist_wheel" runs correctly.
TO DO: check that the resulting distribution installs correctly.
1 parent 5e06fd4 commit f38d1ca

File tree

2 files changed

+24
-50
lines changed

2 files changed

+24
-50
lines changed

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2010-2018, Eric O. LEBIGOT (EOL).
1+
Copyright (c) 2010-2020, Eric O. LEBIGOT (EOL).
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

setup.py

+23-49
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,17 @@
66
import os
77
import sys
88

9-
min_version = (2, 3)
9+
# setuptools has python_requires, but distutils doesn't, so we test the
10+
# Python version manually:
11+
min_version = (2, 7)
1012
error_msg = ("Sorry, this package is for Python %d.%d and higher only." %
1113
min_version)
12-
1314
try:
1415
if sys.version_info < min_version:
1516
sys.exit(error_msg)
1617
except AttributeError: # sys.version_info was introduced in Python 2.0
1718
sys.exit(error_msg)
1819

19-
# Determination of the directory that contains the source code:
20-
if os.path.exists('uncertainties'):
21-
# Case of a direct download of a Python-version-specific Git
22-
# branch:
23-
package_dir = 'uncertainties'
24-
else:
25-
# Case of a PyPI package download:
26-
if sys.version_info >= (2, 7):
27-
package_dir = 'uncertainties-py27'
28-
else:
29-
package_dir = 'uncertainties-py23'
30-
31-
#! The following code was intended to automatically fetch the version
32-
# number; however, it fails when run from Python3 if the downloaded
33-
# code is not the Python 3 version. An alternative approach would be
34-
# to run 2to3 just before, instead of using build_py_2to3 (which does
35-
# not modify the source), but care should be taken so that users can
36-
# run the setup.py script many times anyway.
37-
## Access to the local uncertainties package (and not to an already
38-
## installed uncertainties package):
39-
# sys.path.insert(0, package_dir)
40-
# uncertainties = __import__(package_dir)
41-
4220
# Common options for distutils/setuptools's setup():
4321
setup_options = dict(
4422
name='uncertainties',
@@ -157,6 +135,7 @@
157135
158136
Main changes:
159137
138+
- 3.1.4: Python 2.7+ is now required.
160139
- 3.1.2: Fix for NumPy 1.17 and ``unumpy.ulinalg.pinv()``.
161140
- 3.1: Variables built through a correlation or covariance matrix, and that
162141
have uncertainties that span many orders of magnitude are now
@@ -293,11 +272,6 @@
293272
.. _main website: http://uncertainties-python-package.readthedocs.io/
294273
.. _code updater: http://uncertainties-python-package.readthedocs.io/en/latest/index.html#migration-from-version-1-to-version-2
295274
.. _formatting: http://uncertainties-python-package.readthedocs.io/en/latest/user_guide.html#printing''',
296-
keywords=[
297-
'error propagation', 'uncertainties', 'uncertainty calculations',
298-
'standard deviation', 'derivatives', 'partial derivatives',
299-
'differentiation'
300-
],
301275
classifiers=[
302276
'Development Status :: 5 - Production/Stable',
303277
'Intended Audience :: Developers',
@@ -307,10 +281,6 @@
307281
'License :: OSI Approved :: BSD License',
308282
'Operating System :: OS Independent',
309283
'Programming Language :: Python',
310-
'Programming Language :: Python :: 2.3',
311-
'Programming Language :: Python :: 2.4',
312-
'Programming Language :: Python :: 2.5',
313-
'Programming Language :: Python :: 2.6',
314284
'Programming Language :: Python :: 2.7',
315285
'Programming Language :: Python :: 3',
316286
# Python 3.1 failed because of a problem with NumPy 1.6.1 (whereas
@@ -334,8 +304,11 @@
334304
'Topic :: Utilities'
335305
],
336306

337-
# Where to find the source code:
338-
package_dir={'uncertainties': package_dir},
307+
keywords=[
308+
'error propagation', 'uncertainties', 'uncertainty calculations',
309+
'standard deviation', 'derivatives', 'partial derivatives',
310+
'differentiation'
311+
],
339312

340313
# Files are defined in MANIFEST (which is automatically created by
341314
# python setup.py sdist bdist_wheel):
@@ -344,7 +317,7 @@
344317
'uncertainties.lib1to2.fixes'
345318
],
346319

347-
# Wheels are built for both Python 2 and Python 3:
320+
# The code runs with both Python 2 and Python 3:
348321
options={"bdist_wheel": {"universal": True}}
349322
)
350323

@@ -355,17 +328,25 @@
355328

356329
# Some setuptools-specific options can be added:
357330

358-
addtl_setup_options = {
331+
addtl_setup_options = dict(
359332

360-
'install_requires': ['future'],
361-
'tests_require': ['nose', 'numpy'],
333+
project_urls={
334+
'Documentation':
335+
'https://uncertainties-python-package.readthedocs.io/',
336+
'Source': 'https://github.com/lebigot/uncertainties'
337+
},
338+
339+
install_requires=['future'],
340+
341+
tests_require=['nose', 'numpy'],
342+
362343
# Optional dependencies install using:
363344
# `easy_install uncertainties[optional]`
364-
'extras_require': {
345+
extras_require={
365346
'optional': ['numpy'],
366347
'docs': ['sphinx'],
367348
}
368-
}
349+
)
369350

370351
# easy_install uncertainties[tests] option:
371352
addtl_setup_options['extras_require']['tests'] = (
@@ -381,13 +362,6 @@
381362
except ImportError:
382363
from distutils.core import setup
383364

384-
# distutils.core.setup is not like setuptools: it does not have an
385-
# option for automatically calling 2to3 if Python 3 is used, so the
386-
# conversion is done here:
387-
if sys.version_info >= (3,):
388-
import subprocess
389-
subprocess.check_call(["2to3", "-w", "."])
390-
391365
# End of setup definition
392366

393367
setup(**setup_options)

0 commit comments

Comments
 (0)