|
@@ -0,0 +1,222 @@
|
|
1
|
+"""A setuptools based setup module.
|
|
2
|
+
|
|
3
|
+See:
|
|
4
|
+https://packaging.python.org/guides/distributing-packages-using-setuptools/
|
|
5
|
+https://github.com/pypa/sampleproject
|
|
6
|
+"""
|
|
7
|
+
|
|
8
|
+# Always prefer setuptools over distutils
|
|
9
|
+from setuptools import setup, find_packages
|
|
10
|
+import pathlib
|
|
11
|
+import os
|
|
12
|
+
|
|
13
|
+__version__ = '__0.0.0__'
|
|
14
|
+with open('pyheatpump/__init__.py') as f:
|
|
15
|
+ line = f.readline()
|
|
16
|
+ __version__ = line.split("'")[1]
|
|
17
|
+
|
|
18
|
+here = pathlib.Path(__file__).parent.resolve()
|
|
19
|
+
|
|
20
|
+# Get the long description from the README file
|
|
21
|
+long_description = (here / 'README.md').read_text(encoding='utf-8')
|
|
22
|
+
|
|
23
|
+# Arguments marked as "Required" below must be included for upload to PyPI.
|
|
24
|
+# Fields marked as "Optional" may be commented out.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+def get_packages(package):
|
|
28
|
+ """
|
|
29
|
+ Return root package and all sub-packages.
|
|
30
|
+ """
|
|
31
|
+ return [
|
|
32
|
+ dirpath
|
|
33
|
+ for dirpath, dirnames, filenames in os.walk(package)
|
|
34
|
+ if os.path.exists(os.path.join(dirpath, "__init__.py"))
|
|
35
|
+ ]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+setup(
|
|
39
|
+ # This is the name of your project. The first time you publish this
|
|
40
|
+ # package, this name will be registered for you. It will determine how
|
|
41
|
+ # users can install this project, e.g.:
|
|
42
|
+ #
|
|
43
|
+ # $ pip install sampleproject
|
|
44
|
+ #
|
|
45
|
+ # And where it will live on PyPI: https://pypi.org/project/sampleproject/
|
|
46
|
+ #
|
|
47
|
+ # There are some restrictions on what makes a valid project name
|
|
48
|
+ # specification here:
|
|
49
|
+ # https://packaging.python.org/specifications/core-metadata/#name
|
|
50
|
+ name='pyHeatpump', # Required
|
|
51
|
+
|
|
52
|
+ # Versions should comply with PEP 440:
|
|
53
|
+ # https://www.python.org/dev/peps/pep-0440/
|
|
54
|
+ #
|
|
55
|
+ # For a discussion on single-sourcing the version across setup.py and the
|
|
56
|
+ # project code, see
|
|
57
|
+ # https://packaging.python.org/en/latest/single_source_version.html
|
|
58
|
+ version=__version__, # Required
|
|
59
|
+
|
|
60
|
+ # This is a one-line description or tagline of what your project does. This
|
|
61
|
+ # corresponds to the "Summary" metadata field:
|
|
62
|
+ # https://packaging.python.org/specifications/core-metadata/#summary
|
|
63
|
+ description='pyHeatpump connects modbus to REST APIs', # Optional
|
|
64
|
+
|
|
65
|
+ # This is an optional longer description of your project that represents
|
|
66
|
+ # the body of text which users will see when they visit PyPI.
|
|
67
|
+ #
|
|
68
|
+ # Often, this is the same as your README, so you can just read it in from
|
|
69
|
+ # that file directly (as we have already done above)
|
|
70
|
+ #
|
|
71
|
+ # This field corresponds to the "Description" metadata field:
|
|
72
|
+ # https://packaging.python.org/specifications/core-metadata/#description-optional
|
|
73
|
+ #long_description=long_description, # Optional
|
|
74
|
+
|
|
75
|
+ # Denotes that our long_description is in Markdown; valid values are
|
|
76
|
+ # text/plain, text/x-rst, and text/markdown
|
|
77
|
+ #
|
|
78
|
+ # Optional if long_description is written in reStructuredText (rst) but
|
|
79
|
+ # required for plain-text or Markdown; if unspecified, "applications should
|
|
80
|
+ # attempt to render [the long_description] as text/x-rst; charset=UTF-8 and
|
|
81
|
+ # fall back to text/plain if it is not valid rst" (see link below)
|
|
82
|
+ #
|
|
83
|
+ # This field corresponds to the "Description-Content-Type" metadata field:
|
|
84
|
+ # https://packaging.python.org/specifications/core-metadata/#description-content-type-optional
|
|
85
|
+ #long_description_content_type='text/markdown', # Optional (see note above)
|
|
86
|
+
|
|
87
|
+ # This should be a valid link to your project's main homepage.
|
|
88
|
+ #
|
|
89
|
+ # This field corresponds to the "Home-Page" metadata field:
|
|
90
|
+ # https://packaging.python.org/specifications/core-metadata/#home-page-optional
|
|
91
|
+ url='https://git.yannweb.net/maxime-alves/pyHeatpump', # Optional
|
|
92
|
+
|
|
93
|
+ # This should be your name or the name of the organization which owns the
|
|
94
|
+ # project.
|
|
95
|
+ author='Maxime Alves', # Optional
|
|
96
|
+
|
|
97
|
+ # This should be a valid email address corresponding to the author listed
|
|
98
|
+ # above.
|
|
99
|
+ author_email='maxime@freepoteries.fr', # Optional
|
|
100
|
+
|
|
101
|
+ # Classifiers help users find your project by categorizing it.
|
|
102
|
+ #
|
|
103
|
+ # For a list of valid classifiers, see https://pypi.org/classifiers/
|
|
104
|
+ # classifiers=[ # Optional
|
|
105
|
+ # # How mature is this project? Common values are
|
|
106
|
+ # # 3 - Alpha
|
|
107
|
+ # # 4 - Beta
|
|
108
|
+ # # 5 - Production/Stable
|
|
109
|
+ # 'Development Status :: 3 - Alpha',
|
|
110
|
+ #
|
|
111
|
+ # # Indicate who your project is intended for
|
|
112
|
+ # 'Intended Audience :: Developers',
|
|
113
|
+ # 'Topic :: Software Development :: Build Tools',
|
|
114
|
+ #
|
|
115
|
+ # # Pick your license as you wish
|
|
116
|
+ # 'License :: OSI Approved :: MIT License',
|
|
117
|
+ #
|
|
118
|
+ # # Specify the Python versions you support here. In particular, ensure
|
|
119
|
+ # # that you indicate you support Python 3. These classifiers are *not*
|
|
120
|
+ # # checked by 'pip install'. See instead 'python_requires' below.
|
|
121
|
+ # 'Programming Language :: Python :: 3',
|
|
122
|
+ # 'Programming Language :: Python :: 3.5',
|
|
123
|
+ # 'Programming Language :: Python :: 3.6',
|
|
124
|
+ # 'Programming Language :: Python :: 3.7',
|
|
125
|
+ # 'Programming Language :: Python :: 3.8',
|
|
126
|
+ # 'Programming Language :: Python :: 3 :: Only',
|
|
127
|
+ # ],
|
|
128
|
+
|
|
129
|
+ # This field adds keywords for your project which will appear on the
|
|
130
|
+ # project page. What does your project relate to?
|
|
131
|
+ #
|
|
132
|
+ # Note that this is a list of additional keywords, separated
|
|
133
|
+ # by commas, to be used to assist searching for the distribution in a
|
|
134
|
+ # larger catalog.
|
|
135
|
+ keywords='modbus, api', # Optional
|
|
136
|
+
|
|
137
|
+ # When your source code is in a subdirectory under the project root, e.g.
|
|
138
|
+ # `src/`, it is necessary to specify the `package_dir` argument.
|
|
139
|
+ package_dir={'pyheatpump': 'pyheatpump'}, # Optional
|
|
140
|
+
|
|
141
|
+ # You can just specify package directories manually here if your project is
|
|
142
|
+ # simple. Or you can use find_packages().
|
|
143
|
+ #
|
|
144
|
+ # Alternatively, if you just want to distribute a single Python file, use
|
|
145
|
+ # the `py_modules` argument instead as follows, which will expect a file
|
|
146
|
+ # called `my_module.py` to exist:
|
|
147
|
+ #
|
|
148
|
+ # py_modules=["my_module"],
|
|
149
|
+ #
|
|
150
|
+ packages=get_packages('pyheatpump'), # Required
|
|
151
|
+
|
|
152
|
+ # Specify which Python versions you support. In contrast to the
|
|
153
|
+ # 'Programming Language' classifiers above, 'pip install' will check this
|
|
154
|
+ # and refuse to install the project if the version does not match. See
|
|
155
|
+ # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires
|
|
156
|
+ python_requires='>=3.5, <4',
|
|
157
|
+
|
|
158
|
+ # This field lists other packages that your project depends on to run.
|
|
159
|
+ # Any package you put here will be installed by pip when your project is
|
|
160
|
+ # installed, so they must be valid existing projects.
|
|
161
|
+ #
|
|
162
|
+ # For an analysis of "install_requires" vs pip's requirements files see:
|
|
163
|
+ # https://packaging.python.org/en/latest/requirements.html
|
|
164
|
+ install_requires=[
|
|
165
|
+ 'starlette>=0.13,<1',
|
|
166
|
+ 'uvicorn>=0.11,<1',
|
|
167
|
+ 'umodbus>=1.0.3,<2',
|
|
168
|
+ 'click>=7.1.2,<8',
|
|
169
|
+ 'requests>=2.24.0,<3',
|
|
170
|
+ 'netifaces>=0.10.9,<1'
|
|
171
|
+ ],
|
|
172
|
+
|
|
173
|
+ # List additional groups of dependencies here (e.g. development
|
|
174
|
+ # dependencies). Users will be able to install these using the "extras"
|
|
175
|
+ # syntax, for example:
|
|
176
|
+ #
|
|
177
|
+ # $ pip install sampleproject[dev]
|
|
178
|
+ #
|
|
179
|
+ # Similar to `install_requires` above, these must be valid existing
|
|
180
|
+ # projects.
|
|
181
|
+ extras_require={ # Optional
|
|
182
|
+ 'test': ['pytest', 'asynctest', 'pytest-asyncio'],
|
|
183
|
+ },
|
|
184
|
+
|
|
185
|
+ # If there are data files included in your packages that need to be
|
|
186
|
+ # installed, specify them here.
|
|
187
|
+ package_data={ # Optional
|
|
188
|
+ 'db': ['db/pyheatpump.sql'],
|
|
189
|
+ },
|
|
190
|
+
|
|
191
|
+ # Although 'package_data' is the preferred approach, in some case you may
|
|
192
|
+ # need to place data files outside of your packages. See:
|
|
193
|
+ # http://docs.python.org/distutils/setupscript.html#installing-additional-files
|
|
194
|
+ #
|
|
195
|
+ # In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
|
|
196
|
+ # data_files=[('my_data', ['data/data_file'])], # Optional
|
|
197
|
+
|
|
198
|
+ # To provide executable scripts, use entry points in preference to the
|
|
199
|
+ # "scripts" keyword. Entry points provide cross-platform support and allow
|
|
200
|
+ # `pip` to create the appropriate form of executable for the target
|
|
201
|
+ # platform.
|
|
202
|
+ #
|
|
203
|
+ # For example, the following would provide a command called `sample` which
|
|
204
|
+ # executes the function `main` from this package when invoked:
|
|
205
|
+ entry_points={ # Optional
|
|
206
|
+ 'console_scripts': [
|
|
207
|
+ 'pyheatpump=pyheatpump.cli:cli',
|
|
208
|
+ ],
|
|
209
|
+ },
|
|
210
|
+
|
|
211
|
+ # List additional URLs that are relevant to your project as a dict.
|
|
212
|
+ #
|
|
213
|
+ # This field corresponds to the "Project-URL" metadata fields:
|
|
214
|
+ # https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use
|
|
215
|
+ #
|
|
216
|
+ # Examples listed include a pattern for specifying where the package tracks
|
|
217
|
+ # issues, where the source is hosted, where to say thanks to the package
|
|
218
|
+ # maintainers, and where to support the project financially. The key is
|
|
219
|
+ # what's used to render the link text on PyPI.
|
|
220
|
+ project_urls={ # Optional
|
|
221
|
+ },
|
|
222
|
+)
|