Skip to content

Commit d24b42b

Browse files
authored
Merge pull request #50 from sbdchd/steve/fix-pypi-metadata
fix(setup.py): pypi metadata
2 parents 511d567 + a2c1bfd commit d24b42b

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

gen/templates/setup.mustache

+11-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
{{>partial_header}}
44

5+
import os
56
from setuptools import setup, find_packages # noqa: H301
67

78
NAME = "{{{projectName}}}"
@@ -24,21 +25,27 @@ REQUIRES.append("aiohttp >= 3.0.0")
2425
REQUIRES.append("tornado>=4.2,<5")
2526
{{/tornado}}
2627
28+
here = os.path.abspath(os.path.dirname(__file__))
29+
30+
def get_file_text(file_name):
31+
with open(os.path.join(here, file_name)) as in_file:
32+
return in_file.read()
33+
2734
setup(
2835
name=NAME,
2936
version=VERSION,
3037
description="{{appName}}",
3138
author="{{#infoName}}{{infoName}}{{/infoName}}{{^infoName}}OpenAPI Generator community{{/infoName}}",
3239
author_email="{{#infoEmail}}{{infoEmail}}{{/infoEmail}}{{^infoEmail}}[email protected]{{/infoEmail}}",
33-
url="{{packageUrl}}",
40+
url="https://github.com/muxinc/mux-python",
3441
keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"],
3542
install_requires=REQUIRES,
3643
packages=find_packages(exclude=["test", "tests"]),
3744
include_package_data=True,
45+
long_description=get_file_text("README.md"),
46+
long_description_content_type="text/markdown",
3847
{{#licenseInfo}}license="{{licenseInfo}}",
39-
{{/licenseInfo}}long_description="""\
40-
{{appDescription}} # noqa: E501
41-
"""
48+
{{/licenseInfo}}
4249
)
4350
{{/-last}}
4451
{{/apis}}

setup.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"""
1212

1313

14+
import os
1415
from setuptools import setup, find_packages # noqa: H301
1516

1617
NAME = "mux_python"
@@ -24,18 +25,23 @@
2425

2526
REQUIRES = ["urllib3 >= 1.25.3", "six >= 1.10", "python-dateutil"]
2627

28+
here = os.path.abspath(os.path.dirname(__file__))
29+
30+
def get_file_text(file_name):
31+
with open(os.path.join(here, file_name)) as in_file:
32+
return in_file.read()
33+
2734
setup(
2835
name=NAME,
2936
version=VERSION,
3037
description="Mux API",
3138
author="Mux DevEx",
3239
author_email="[email protected]",
33-
url="",
40+
url="https://github.com/muxinc/mux-python",
3441
keywords=["OpenAPI", "OpenAPI-Generator", "Mux API"],
3542
install_requires=REQUIRES,
3643
packages=find_packages(exclude=["test", "tests"]),
3744
include_package_data=True,
38-
long_description="""\
39-
Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501
40-
"""
45+
long_description=get_file_text("README.md"),
46+
long_description_content_type="text/markdown",
4147
)

0 commit comments

Comments
 (0)