Skip to content

Commit 2dd4921

Browse files
committed
Updated for 1.0.0 release
1 parent beb31b5 commit 2dd4921

2 files changed

Lines changed: 50 additions & 32 deletions

File tree

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# This includes the license file(s) in the wheel.
99
# https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file
1010

11-
license_files = LICENSE
11+
# license_files = LICENSE
1212

1313
[bdist_wheel]
1414
# This flag says to generate wheels that support both Python 2 and Python

setup.py

Lines changed: 49 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,58 @@
11
# -------------------------------------------------------------------------
2-
# Copyright (c) 2020, PTC Inc. and/or all its affiliates. All rights reserved.
2+
# Copyright (c) PTC Inc. and/or all its affiliates. All rights reserved.
33
# See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
66

7+
# Package Setup Script - run this to build the package
8+
# Usage - python setup.py <build> sdist bdist_wheel
9+
# Example: python setup.py 1.0.0 sdist bdist_wheel
10+
711
import setuptools
8-
import sys
12+
import pathlib, os
13+
14+
def read(rel_path):
15+
# type: (str) -> str
16+
here = os.path.abspath(os.path.dirname(__file__))
17+
# intentionally *not* adding an encoding option to open, See:
18+
# https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690
19+
with open(os.path.join(here, rel_path)) as fp:
20+
return fp.read()
21+
22+
def get_version(rel_path):
23+
# type: (str) -> str
24+
for line in read(rel_path).splitlines():
25+
if line.startswith('__version__'):
26+
# __version__ = "0.9"
27+
delim = '"' if '"' in line else "'"
28+
return line.split(delim)[1]
29+
raise RuntimeError("Unable to find version string.")
930

10-
with open("README.md", "r") as fh:
11-
long_description = fh.read()
31+
here = pathlib.Path(__file__).parent.resolve()
1232

13-
print("Arguments list: ", str(sys.argv))
14-
if len(sys.argv) < 4:
15-
print("Not enough arguments. Arguments list: ", str(sys.argv))
16-
else:
17-
version = sys.argv[1]
18-
sys.argv.pop(1)
19-
setuptools.setup(
20-
name="kepconfig",
21-
version= version,
22-
author="PTC Inc",
23-
# author_email="author@example.com",
33+
# Get the long description from the README file
34+
long_description = (here / 'README.md').read_text(encoding='utf-8')
2435

25-
description="SDK package for Kepware Configuration API",
26-
keywords="Kepware OPC Configuration Thingworx",
27-
long_description=long_description,
28-
long_description_content_type="text/markdown",
29-
url="TBD",
30-
project_urls={},
31-
packages=setuptools.find_packages(),
32-
classifiers=[
33-
"Development Status :: 4 - Beta",
34-
'License :: OSI Approved :: MIT License',
35-
"Programming Language :: Python :: 3",
36-
"Operating System :: OS Independent",
37-
"Intended Audience :: Manufacturing",
38-
],
39-
python_requires='>=3.6',
40-
)
36+
setuptools.setup(
37+
name="kepconfig",
38+
version= get_version("kepconfig/__init__.py"),
39+
author="PTC Inc",
40+
description="SDK package for Kepware Configuration API",
41+
keywords="Kepware, OPC, Configuration, Thingworx",
42+
license="MIT License",
43+
long_description=long_description,
44+
long_description_content_type="text/markdown",
45+
url="https://github.com/PTCInc/Kepware-ConfigAPI-SDK-Python",
46+
project_urls={},
47+
packages=setuptools.find_packages(),
48+
classifiers=[
49+
"Development Status :: 5 - Production/Stable",
50+
"License :: OSI Approved :: MIT License",
51+
"Programming Language :: Python",
52+
"Programming Language :: Python :: 3",
53+
"Operating System :: OS Independent",
54+
"Intended Audience :: Manufacturing",
55+
"Intended Audience :: Developers",
56+
],
57+
python_requires='>=3.6',
58+
)

0 commit comments

Comments
 (0)