Skip to content

Commit 23baf5d

Browse files
committed
finish updating setup scripts
1 parent ae11d2a commit 23baf5d

File tree

5 files changed

+31
-34
lines changed

5 files changed

+31
-34
lines changed

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
include quantities/constants/NIST_codata.txt
2-
include quantities/tests/*.py
1+
include distribute_setup.py
2+
include CHANGES.txt

doc/conf.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@
4848
# |version| and |release|, also used in various other places throughout the
4949
# built documents.
5050
#
51-
import quantities
51+
from ConfigParser import ConfigParser
52+
cfg = ConfigParser()
53+
cfg.read('../setup.cfg')
5254
# The short X.Y version.
53-
version = quantities.__version__
55+
version = cfg.get('metadata', 'version')
5456
# The full version, including alpha/beta/rc tags.
55-
release = quantities.__version__
57+
release = version
5658

5759
# The language for content autogenerated by Sphinx. Refer to documentation
5860
# for a list of supported languages.

quantities/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
__version__ = '0.6.0'
2+
__version__ = '0.7.0'

setup.cfg

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,9 @@ name = Quantities
2929
platforms = Any
3030
requires = numpy (>=1.3.0)
3131
url = http://packages.python.org/quantities
32-
version = 0.6.96
32+
version = 0.7.0
33+
zip_safe = False
34+
35+
[aliases]
36+
release = egg_info
37+
source = register sdist upload --sign

setup.py

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@
1616
from __future__ import with_statement
1717

1818
from ConfigParser import ConfigParser
19-
import os
20-
import sys
2119

2220
from distribute_setup import use_setuptools
2321
use_setuptools()
2422
from setuptools import Command, setup
25-
from setuptools.command.sdist import sdist as _sdist
2623

2724
class constants(Command):
2825

@@ -56,54 +53,47 @@ def run(self):
5653
d = "{'value': %s, 'precision': %s, 'units': '%s'}"%(val, prec, unit)
5754
f.write("physical_constants['%s'] = %s\n"%(name, d))
5855

59-
class sdist(_sdist):
60-
61-
def run(self):
62-
with open('quantities/version.py') as f:
63-
for line in f:
64-
if line.startswith('__version__'):
65-
exec(line)
66-
cfg = ConfigParser()
67-
cfg.read('setup.cfg')
68-
if __version__ != cfg.get('metadata', 'version'):
69-
with open('setup.cfg') as f:
70-
lines = f.readlines()
71-
with open('setup.cfg', 'w') as f:
72-
for line in lines:
73-
if line.startswith('version'):
74-
line = 'version = %s\n' % __version__
75-
f.write(line)
76-
_sdist.run(self)
7756

7857
cfg = ConfigParser()
7958
cfg.read('setup.cfg')
8059

60+
with open('quantities/version.py') as f:
61+
for line in f:
62+
if line.startswith('__version__'):
63+
exec(line)
64+
if __version__ != cfg.get('metadata', 'version'):
65+
with open('setup.cfg') as f:
66+
lines = f.readlines()
67+
with open('setup.cfg', 'w') as f:
68+
for line in lines:
69+
if line.startswith('version'):
70+
line = 'version = %s\n' % __version__
71+
f.write(line)
72+
8173
setup(
8274
author = cfg.get('metadata', 'author'),
8375
author_email = cfg.get('metadata', 'author_email'),
8476
classifiers = cfg.get('metadata', 'classifiers').split('\n'),
8577
cmdclass = {
8678
'constants' : constants,
87-
'sdist' : sdist,
8879
},
8980
description = cfg.get('metadata', 'description'),
9081
download_url = cfg.get('metadata', 'download_url'),
9182
keywords = ['quantities', 'physical quantities', 'units'],
9283
license = 'BSD',
9384
long_description = cfg.get('metadata', 'long_description'),
9485
name = "quantities",
95-
package_data = {
96-
'quantities':['tests/*', 'constants/NIST_codata.txt']
97-
},
9886
packages = [
9987
'quantities',
100-
'quantities.units',
10188
'quantities.constants',
102-
'quantities.umath'
89+
'quantities.tests',
90+
'quantities.umath',
91+
'quantities.units',
10392
],
10493
platforms = cfg.get('metadata', 'platforms'),
10594
requires = cfg.get('metadata', 'requires').split('\n'),
10695
test_suite = 'nose.collector',
10796
url = cfg.get('metadata', 'url'),
10897
version = cfg.get('metadata', 'version'),
98+
zip_safe = cfg.getboolean('metadata', 'zip_safe'),
10999
)

0 commit comments

Comments
 (0)