This repository has been archived by the owner on Jun 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up setup.py, dependencies. (#1940)
- Loading branch information
1 parent
c58c306
commit c5fc177
Showing
4 changed files
with
167 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 77 additions & 50 deletions
127
src/main/resources/com/google/api/codegen/py/setup.py.snip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,82 @@ | ||
@extends "py/common.snip" | ||
|
||
@snippet generate(metadata) | ||
{@licenseSection(metadata.fileHeader)} | ||
|
||
"""A setup module for the GAPIC {@metadata.fullName} library. | ||
|
||
See: | ||
https://packaging.python.org/en/latest/distributing.html | ||
https://github.com/pypa/sampleproject | ||
""" | ||
|
||
from setuptools import setup, find_packages | ||
import io | ||
import sys | ||
|
||
install_requires = [ | ||
@join packageDep : metadata.dependencies | ||
'{@packageDep.name} >= {@packageDep.versionBound.lower}, < {@packageDep.versionBound.upper}', | ||
@end | ||
] | ||
|
||
with io.open('README.rst', 'r', encoding='utf-8') as readme_file: | ||
long_description = readme_file.read() | ||
|
||
setup( | ||
name='{@metadata.gapicPackageName}', | ||
version='{@metadata.packageVersionBound.lower}', | ||
author='{@metadata.author}', | ||
author_email='{@metadata.email}', | ||
classifiers=[ | ||
'Intended Audience :: Developers', | ||
'Development Status :: {@metadata.developmentStatus}', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: Apache Software License', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
], | ||
description='GAPIC library for the {@metadata.fullName}', | ||
include_package_data=True, | ||
long_description=long_description, | ||
install_requires=install_requires, | ||
license='{@metadata.licenseName}', | ||
packages=find_packages(exclude=('tests*',)), | ||
namespace_packages=[{@quotedList(metadata.namespacePackages)}], | ||
url='{@metadata.homepage}', | ||
zip_safe=False, | ||
) | ||
{@licenseSection(metadata.fileHeader)} | ||
|
||
import io | ||
import os | ||
|
||
import setuptools | ||
|
||
|
||
# Package metadata. | ||
|
||
name = '{@metadata.gapicPackageName}' | ||
description = '{@metadata.fullName} API client library' | ||
version = '{@metadata.packageVersionBound.lower}' | ||
# Should be one of: | ||
# 'Development Status :: 3 - Alpha' | ||
# 'Development Status :: 4 - Beta' | ||
# 'Development Status :: 5 - Stable' | ||
release_status = '{@metadata.developmentStatus}' | ||
dependencies = [ | ||
@join packageDep : metadata.dependencies | ||
@if packageDep.name != "googleapis-common-protos[grpc]" | ||
'{@packageDep.name} >= {@packageDep.versionBound.lower}, < {@packageDep.versionBound.upper}', | ||
@end | ||
@end | ||
] | ||
|
||
|
||
# Setup boilerplate below this line. | ||
|
||
package_root = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
readme_filename = os.path.join(package_root, 'README.rst') | ||
with io.open(readme_filename, encoding='utf-8') as readme_file: | ||
readme = readme_file.read() | ||
|
||
# Only include packages under the 'google' namespace. Do not include tests, | ||
# benchmarks, etc. | ||
packages = [ | ||
package for package in setuptools.find_packages() | ||
if package.startswith('google')] | ||
|
||
# Determine which namespaces are needed. | ||
namespaces = ['google'] | ||
if 'google.cloud' in packages: | ||
namespaces.append('google.cloud') | ||
|
||
|
||
setuptools.setup( | ||
name=name, | ||
version=version, | ||
description=description, | ||
long_description=readme, | ||
author='Google LLC', | ||
author_email='googleapis-packages@google.com', | ||
license='Apache 2.0', | ||
url='https://github.com/GoogleCloudPlatform/google-cloud-python', | ||
classifiers=[ | ||
release_status, | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: Apache Software License', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Operating System :: OS Independent', | ||
'Topic :: Internet', | ||
], | ||
platforms='Posix; MacOS X; Windows', | ||
packages=packages, | ||
namespace_packages=namespaces, | ||
install_requires=dependencies, | ||
extras_require=extras, | ||
include_package_data=True, | ||
zip_safe=False, | ||
) | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters