Skip to content

Commit 22b4e29

Browse files
authored
Migrate to setup.cfg and pyproject.toml (#299)
1 parent 1c756a0 commit 22b4e29

File tree

5 files changed

+62
-56
lines changed

5 files changed

+62
-56
lines changed

.github/workflows/ci-cd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
python: ['3.7', '3.8', '3.9', '3.10']
32+
python: ['3.8', '3.9', '3.10', '3.11']
3333
os: [macos-latest, ubuntu-latest, windows-latest]
3434
runs-on: ${{ matrix.os }}
3535
steps:

nptdms/version.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
__version_info__ = (1, 6, 1)
2-
__version__ = '.'.join('%d' % d for d in __version_info__)
1+
from importlib import metadata
2+
3+
4+
__version__ = metadata.version('nptdms')
5+
__version_info__ = tuple(int(x) for x in __version__.split('.'))

pyproject.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[build-system]
2+
requires = [
3+
"setuptools",
4+
]
5+
build-backend = "setuptools.build_meta"

setup.cfg

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[metadata]
2+
name = npTDMS
3+
version = 1.6.2
4+
description = Cross-platform, NumPy based module for reading TDMS files produced by LabView
5+
author = Adam Reeve
6+
author_email = adreeve@gmail.com
7+
url = https://github.com/adamreeve/npTDMS
8+
long_description = file: README.rst
9+
license = LGPL
10+
classifiers =
11+
Development Status :: 5 - Production/Stable
12+
Operating System :: OS Independent
13+
Programming Language :: Python
14+
Programming Language :: Python :: 3
15+
Programming Language :: Python :: 3.8
16+
Programming Language :: Python :: 3.9
17+
Programming Language :: Python :: 3.10
18+
Programming Language :: Python :: 3.11
19+
Topic :: Scientific/Engineering
20+
License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
21+
Intended Audience :: Science/Research
22+
Natural Language :: English
23+
24+
[options]
25+
packages =
26+
nptdms
27+
nptdms.export
28+
nptdms.test
29+
install_requires =
30+
numpy
31+
32+
[options.entry_points]
33+
console_scripts =
34+
tdmsinfo = nptdms.tdmsinfo:main
35+
36+
[options.extras_require]
37+
test =
38+
pytest >= 3.1.0
39+
hypothesis
40+
pytest-benchmark
41+
thermocouples_reference
42+
scipy
43+
pandas =
44+
pandas
45+
hdf =
46+
h5py >= 2.10.0
47+
thermocouple_scaling =
48+

setup.py

100644100755
+3-53
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,7 @@
1-
import os
1+
#!/usr/bin/env python
22

33
from setuptools import setup
44

55

6-
def read_version():
7-
here = os.path.abspath(os.path.dirname(__file__))
8-
version_path = os.path.sep.join((here, "nptdms", "version.py"))
9-
v_globals = {}
10-
v_locals = {}
11-
exec(open(version_path).read(), v_globals, v_locals)
12-
return v_locals['__version__']
13-
14-
15-
setup(
16-
name = 'npTDMS',
17-
version = read_version(),
18-
description = ("Cross-platform, NumPy based module for reading "
19-
"TDMS files produced by LabView."),
20-
author = 'Adam Reeve',
21-
author_email = 'adreeve@gmail.com',
22-
url = 'https://github.com/adamreeve/npTDMS',
23-
packages = ['nptdms', 'nptdms.export', 'nptdms.test'],
24-
long_description=open('README.rst').read(),
25-
license = 'LGPL',
26-
classifiers = [
27-
'Development Status :: 4 - Beta',
28-
'Operating System :: OS Independent',
29-
'Programming Language :: Python',
30-
'Programming Language :: Python :: 3',
31-
'Programming Language :: Python :: 3.7',
32-
'Programming Language :: Python :: 3.8',
33-
'Programming Language :: Python :: 3.9',
34-
'Programming Language :: Python :: 3.10',
35-
'Topic :: Scientific/Engineering',
36-
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
37-
'Intended Audience :: Science/Research',
38-
'Natural Language :: English',
39-
],
40-
install_requires = ['numpy'],
41-
extras_require = {
42-
'test': [
43-
'pytest>=3.1.0',
44-
'hypothesis',
45-
'pytest-benchmark',
46-
'thermocouples_reference',
47-
'scipy',
48-
],
49-
'pandas': ['pandas'],
50-
'hdf': ['h5py>=2.10.0'],
51-
'thermocouple_scaling': [], # Kept for backwards compatibility
52-
},
53-
entry_points = """
54-
[console_scripts]
55-
tdmsinfo=nptdms.tdmsinfo:main
56-
"""
57-
)
6+
if __name__ == '__main__':
7+
setup()

0 commit comments

Comments
 (0)