Skip to content

Commit 64dcb73

Browse files
committed
Update project structure
In order to be compatible with latest setuptools the project structure was updated.
1 parent 25af597 commit 64dcb73

File tree

4 files changed

+64
-57
lines changed

4 files changed

+64
-57
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

pyproject.toml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[build-system]
2+
requires = ["hatchling >= 1.26", "wheel >= 0.45.0"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "sensirion-i2c-driver"
7+
description = "Base Driver for Communicating With I2C Devices"
8+
9+
readme = "README.md"
10+
version = "1.0.2"
11+
requires-python = ">=3.8,<4.0"
12+
13+
authors = [
14+
{ name = "Sensirion", email = "[email protected]" },
15+
]
16+
17+
license = "BSD-3-Clause"
18+
license-files = ["LICENSE"]
19+
20+
keywords = ["sensirion", "i2c", "driver"]
21+
22+
classifiers = [
23+
"Intended Audience :: Developers",
24+
"Topic :: System :: Hardware :: Hardware Drivers",
25+
"Topic :: Software Development :: Build Tools",
26+
"Programming Language :: Python :: 3.8",
27+
"Programming Language :: Python :: 3.9",
28+
"Programming Language :: Python :: 3.10",
29+
"Programming Language :: Python :: 3.11",
30+
]
31+
32+
dependencies = []
33+
34+
[project.optional-dependencies]
35+
36+
docs=[
37+
38+
"sphinx-rtd-theme==3.0.2",
39+
"sphinx==8.2.3"
40+
]
41+
42+
test= [
43+
"flake8>=7.1.0",
44+
"mock~=5.2.0",
45+
"pytest~=8.4.0",
46+
"pytest-cov~=6.2.1",
47+
"setuptools>=73.2.0"
48+
]
49+
50+
[project.urls]
51+
Changelog = "https://github.com/Sensirion/python-i2c-driver/blob/master/CHANGELOG.rst"
52+
Repository = "https://github.com/sensirion/python-i2c-driver"
53+
Documentation = "https://sensirion.github.io/python-i2c-driver"
54+
55+
[tool.setuptools]
56+
# see https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
57+
packages = ["sensirion_i2c_driver"] # name of python package

sensirion_i2c_driver/version.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22
# (c) Copyright 2019 Sensirion AG, Switzerland
33

44
from __future__ import absolute_import, division, print_function
5-
version = "1.0.1"
5+
6+
import importlib.metadata as metadata
7+
from typing import Final
8+
9+
version: Final[str] = metadata.version("sensirion_i2c_driver")

setup.py

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,6 @@
22
# (c) Copyright 2019 Sensirion AG, Switzerland
33

44
from __future__ import absolute_import, division, print_function
5-
from setuptools import setup, find_packages
6-
import os
7-
import re
5+
from distutils.core import setup
86

9-
10-
# Read version number from version.py
11-
version_line = open("sensirion_i2c_driver/version.py", "rt").read()
12-
result = re.search(r"^version = ['\"]([^'\"]*)['\"]", version_line, re.M)
13-
if result:
14-
version_string = result.group(1)
15-
else:
16-
raise RuntimeError("Unable to find version string")
17-
18-
19-
# Use README.rst and CHANGELOG.rst as package description
20-
root_path = os.path.dirname(__file__)
21-
readme = open(os.path.join(root_path, 'README.rst')).read()
22-
changelog = open(os.path.join(root_path, 'CHANGELOG.rst')).read()
23-
long_description = readme.strip() + "\n\n" + changelog.strip() + "\n"
24-
25-
26-
setup(
27-
name='sensirion-i2c-driver',
28-
version=version_string,
29-
author='Sensirion',
30-
author_email='[email protected]',
31-
description='Base Driver for Communicating With I2C Devices',
32-
license='BSD',
33-
keywords='sensirion i2c driver',
34-
url='https://github.com/sensirion/python-i2c-driver',
35-
packages=find_packages(exclude=['tests', 'tests.*']),
36-
long_description=long_description,
37-
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4',
38-
install_requires=[
39-
],
40-
extras_require={
41-
'test': [
42-
'flake8~=3.7.8',
43-
'mock~=3.0.0',
44-
'pytest~=6.2.5',
45-
'pytest-cov~=3.0.0',
46-
]
47-
},
48-
classifiers=[
49-
'Intended Audience :: Developers',
50-
'License :: OSI Approved :: BSD License',
51-
'Programming Language :: Python :: 2.7',
52-
'Programming Language :: Python :: 3.5',
53-
'Programming Language :: Python :: 3.6',
54-
'Programming Language :: Python :: 3.7',
55-
'Programming Language :: Python :: 3.8',
56-
'Programming Language :: Python :: 3.9',
57-
'Programming Language :: Python :: 3.10',
58-
'Topic :: System :: Hardware :: Hardware Drivers'
59-
]
60-
)
7+
setup()

0 commit comments

Comments
 (0)