-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use pyproject.toml for project configuration (#38)
This PR: - Moves project configuration to `pyproject.toml`. One motivation for this was that `cibuildwheel` was picking up the wrong Python versions, and the recommended way to fix this is to have a `requires-python` setting in our `pyproject.toml`. - Removes `ibm2ieee.version` and `ibm2ieee.__version__`, whose presence complicates the versioning and release process.
- Loading branch information
1 parent
8cfcd9b
commit 1c3d024
Showing
7 changed files
with
46 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,32 @@ | |
requires = ['oldest-supported-numpy', 'setuptools', 'wheel'] | ||
build-backend = 'setuptools.build_meta' | ||
|
||
[project] | ||
name = 'ibm2ieee' | ||
version = '1.3.1' | ||
description = 'Convert IBM hexadecimal floating-point to IEEE 754 floating-point' | ||
readme = 'README.rst' | ||
requires-python = ">=3.7" | ||
license = {file = 'LICENSE.txt'} | ||
authors = [{name = 'Enthought', email = '[email protected]'}] | ||
keywords = ['ibm', 'hfp', 'ieee754', 'hexadecimal', 'floating-point', 'ufunc'] | ||
classifiers=[ | ||
'Development Status :: 5 - Production/Stable', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: BSD License', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python :: 3', | ||
] | ||
dependencies = ['numpy'] | ||
|
||
[project.urls] | ||
readme = 'https://github.com/enthought/ibm2ieee/blob/main/README.rst' | ||
repository = 'https://github.com/enthought/ibm2ieee' | ||
issues = 'https://github.com/enthought/ibm2ieee/issues' | ||
|
||
[tool.setuptools.packages.find] | ||
include = ['ibm2ieee*'] | ||
|
||
[tool.black] | ||
line-length = 79 | ||
target-version = ['py36'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,63 +8,16 @@ | |
# | ||
# Thanks for using Enthought open source! | ||
|
||
import os | ||
|
||
import numpy | ||
import setuptools | ||
|
||
|
||
def get_version_info(): | ||
"""Extract version information as a dictionary from version.py.""" | ||
version_info = {} | ||
version_filename = os.path.join("ibm2ieee", "version.py") | ||
with open(version_filename, "r", encoding="utf-8") as version_module: | ||
version_code = compile(version_module.read(), "version.py", "exec") | ||
exec(version_code, version_info) | ||
return version_info | ||
|
||
|
||
def get_long_description(): | ||
"""Read long description from README.txt.""" | ||
with open("README.rst", "r", encoding="utf-8") as readme: | ||
return readme.read() | ||
|
||
|
||
ibm2ieee_extension = setuptools.Extension( | ||
name="ibm2ieee._ibm2ieee", | ||
sources=["ibm2ieee/_ibm2ieee.c"], | ||
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")], | ||
include_dirs=[numpy.get_include()], | ||
setuptools.setup( | ||
ext_modules=[ | ||
setuptools.Extension( | ||
name="ibm2ieee._ibm2ieee", | ||
sources=["ibm2ieee/_ibm2ieee.c"], | ||
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")], | ||
include_dirs=[numpy.get_include()], | ||
) | ||
], | ||
) | ||
|
||
SHORT_DESCRIPTION = """\ | ||
Convert IBM hexadecimal floating-point data to IEEE 754 floating-point data. | ||
""".rstrip() | ||
|
||
|
||
if __name__ == "__main__": | ||
setuptools.setup( | ||
name="ibm2ieee", | ||
version=get_version_info()["version"], | ||
author="Enthought", | ||
author_email="[email protected]", | ||
url="https://github.com/enthought/ibm2ieee", | ||
description=SHORT_DESCRIPTION, | ||
long_description=get_long_description(), | ||
long_description_content_type="text/x-rst", | ||
keywords="ibm hfp ieee754 hexadecimal floating-point ufunc", | ||
install_requires=["numpy"], | ||
extras_require={ | ||
"test": ["setuptools"], | ||
}, | ||
python_requires=">=3.7", | ||
packages=setuptools.find_packages(), | ||
ext_modules=[ibm2ieee_extension], | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: BSD License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3", | ||
], | ||
) |