Skip to content

Commit 30e99f3

Browse files
committed
Make version.py more idiot proof
1 parent 5de2fe3 commit 30e99f3

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

RELEASING.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Preliminaries
2020

2121
`git commit -a -m "Getting ready for release X.Y.Z"`
2222

23-
* If the directories `dist` or `artifact` exist, delete them.
23+
* If the directory `artifact` exists, delete it.
2424

2525
Tagging
2626
-------
@@ -43,10 +43,7 @@ Build Wheels
4343
------------
4444

4545
* Check on GitHub Actions `github.com/robbmcleod/pyfastnoisesimd/actions` that all the wheels built successfully.
46-
* Download `artifacts.zip` and unzip.
47-
* Make the source tarball with the command
48-
49-
`python setup.py sdist`
46+
* Download `artifacts.zip` and unzip.
5047

5148
Releasing
5249
---------
@@ -57,7 +54,7 @@ Releasing
5754

5855
* Upload the source distribution.
5956

60-
`twine upload dist/pyfastnoisesimd-X.Y.Z.tar.gz`
57+
`twine upload artifact/pyfastnoisesimd*.tar.gz`
6158

6259
* Check on `pypi.org/project/pyfastnoisesimd/#files` that the wheels and source have uploaded as expected.
6360

setup.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
########################################################################
32
#
43
# pyfastnoisesimd
@@ -15,7 +14,6 @@
1514
import os
1615
import platform
1716
import re
18-
import sys
1917
import tempfile
2018
import subprocess
2119

@@ -25,28 +23,25 @@
2523
from distutils.sysconfig import customize_compiler
2624
from setuptools import Extension
2725
from setuptools import setup
28-
from glob import glob
2926

30-
31-
# pyfastnoisesimd version
27+
# `pyfastnoisesimd` version
3228
major_ver = 0
3329
minor_ver = 4
3430
nano_ver = 3
35-
3631
branch = ''
3732

38-
VERSION = "%d.%d.%d.%s" % (major_ver, minor_ver, nano_ver, branch)
33+
VERSION = f'{major_ver}.{minor_ver}.{nano_ver}.{branch}' if branch else f'{major_ver}.{minor_ver}.{nano_ver}'
3934

4035
# Create the version.py file
4136
open('pyfastnoisesimd/version.py', 'w').write('__version__ = "%s"\n' % VERSION)
4237

4338
# Sources and headers
4439
sources = [
45-
'pyfastnoisesimd/fastnoisesimd/FastNoiseSIMD.cpp',
46-
'pyfastnoisesimd/fastnoisesimd/FastNoiseSIMD_internal.cpp',
47-
'pyfastnoisesimd/fastnoisesimd/FastNoiseSIMD_neon.cpp',
48-
'pyfastnoisesimd/wrapper.cpp',
49-
]
40+
'pyfastnoisesimd/fastnoisesimd/FastNoiseSIMD.cpp',
41+
'pyfastnoisesimd/fastnoisesimd/FastNoiseSIMD_internal.cpp',
42+
'pyfastnoisesimd/fastnoisesimd/FastNoiseSIMD_neon.cpp',
43+
'pyfastnoisesimd/wrapper.cpp',
44+
]
5045

5146
# For (some versions of) `pip`, the first command run is `python setup.py egg_info`
5247
# which crashes if `numpy` is not present, so we protect it here.
@@ -298,10 +293,10 @@ def compiler_has_flags(self, compiler, name, flags):
298293
Intended Audience :: Information Technology
299294
License :: OSI Approved :: BSD License
300295
Programming Language :: Python
301-
Programming Language :: Python :: 3.6
302-
Programming Language :: Python :: 3.7
303296
Programming Language :: Python :: 3.8
304297
Programming Language :: Python :: 3.9
298+
Programming Language :: Python :: 3.10
299+
Programming Language :: Python :: 3.11
305300
Topic :: Software Development :: Libraries :: Python Modules
306301
Topic :: Multimedia :: Graphics :: 3D Modeling
307302
Operating System :: Microsoft :: Windows

0 commit comments

Comments
 (0)