Skip to content

Commit

Permalink
fix #37: package version conform with pep-396
Browse files Browse the repository at this point in the history
  • Loading branch information
ghisvail committed Jul 30, 2014
1 parent 7c9fd9f commit eadc845
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,3 +10,4 @@ dist/
*.egg-info/
doc/build
MANIFEST
pynfft/version.py
1 change: 1 addition & 0 deletions pynfft/__init__.py
Expand Up @@ -16,5 +16,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from pynfft.version import version as __version__
from pynfft.nfft import NFFT
from pynfft.solver import Solver
36 changes: 29 additions & 7 deletions setup.py
Expand Up @@ -107,11 +107,11 @@
),
]


version = '1.3.1'
release = True
if not release:
version += '-dev'
MAJOR = 1
MINOR = 3
MICRO = 1
SUFFIX = "" # Should be blank except for rc's, betas, etc.
VERSION = '%d.%d.%d%s' % (MAJOR, MINOR, MICRO, SUFFIX)

long_description = '''"The NFFT is a C subroutine library for computing the
nonequispaced discrete Fourier transform (NDFT) in one or more dimensions, of
Expand Down Expand Up @@ -144,7 +144,7 @@

setup_args = {
'name': 'pyNFFT',
'version': version,
'version': VERSION,
'author': 'Ghislain Vaillant',
'author_email': 'ghisvail@gmail.com',
'description': 'A pythonic wrapper around NFFT',
Expand All @@ -159,5 +159,27 @@
'install_requires': ['numpy'],
}

if __name__ == '__main__':

# borrowed from pandas / theano
def write_version_py(filename=None):
cnt = """\
version = '%s'
"""
if not filename:
filename = os.path.join(
os.path.dirname(__file__), 'pynfft', 'version.py')

a = open(filename, 'w')
try:
a.write(cnt % (VERSION,))
finally:
a.close()


def do_setup():
write_version_py()
setup(**setup_args)


if __name__ == '__main__':
do_setup()

0 comments on commit eadc845

Please sign in to comment.