Skip to content

Commit

Permalink
Make version.py more idiot proof
Browse files Browse the repository at this point in the history
  • Loading branch information
robbmcleod committed Sep 12, 2023
1 parent 5de2fe3 commit 30e99f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
9 changes: 3 additions & 6 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Preliminaries

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

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

Tagging
-------
Expand All @@ -43,10 +43,7 @@ Build Wheels
------------

* Check on GitHub Actions `github.com/robbmcleod/pyfastnoisesimd/actions` that all the wheels built successfully.
* Download `artifacts.zip` and unzip.
* Make the source tarball with the command

`python setup.py sdist`
* Download `artifacts.zip` and unzip.

Releasing
---------
Expand All @@ -57,7 +54,7 @@ Releasing

* Upload the source distribution.

`twine upload dist/pyfastnoisesimd-X.Y.Z.tar.gz`
`twine upload artifact/pyfastnoisesimd*.tar.gz`

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

Expand Down
23 changes: 9 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
########################################################################
#
# pyfastnoisesimd
Expand All @@ -15,7 +14,6 @@
import os
import platform
import re
import sys
import tempfile
import subprocess

Expand All @@ -25,28 +23,25 @@
from distutils.sysconfig import customize_compiler
from setuptools import Extension
from setuptools import setup
from glob import glob


# pyfastnoisesimd version
# `pyfastnoisesimd` version
major_ver = 0
minor_ver = 4
nano_ver = 3

branch = ''

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

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

# Sources and headers
sources = [
'pyfastnoisesimd/fastnoisesimd/FastNoiseSIMD.cpp',
'pyfastnoisesimd/fastnoisesimd/FastNoiseSIMD_internal.cpp',
'pyfastnoisesimd/fastnoisesimd/FastNoiseSIMD_neon.cpp',
'pyfastnoisesimd/wrapper.cpp',
]
'pyfastnoisesimd/fastnoisesimd/FastNoiseSIMD.cpp',
'pyfastnoisesimd/fastnoisesimd/FastNoiseSIMD_internal.cpp',
'pyfastnoisesimd/fastnoisesimd/FastNoiseSIMD_neon.cpp',
'pyfastnoisesimd/wrapper.cpp',
]

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

0 comments on commit 30e99f3

Please sign in to comment.