ashb commented on a change in pull request #11630:
URL: https://github.com/apache/airflow/pull/11630#discussion_r510809350



##########
File path: provider_packages/SETUP_TEMPLATE.py.jinja2
##########
@@ -0,0 +1,102 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE\
+# OVERWRITTEN WHEN RUNNING
+#
+# ./breeze prepare-provider-readme
+#
+# IF YOU WANT TO MODIFY IT, YOU SHOULD MODIFY THE TEMPLATE
+# `SETUP_TEMPLATE.py.jinja2` IN the `provider_packages` DIRECTORY
+
+"""Setup.py for the {{ PACKAGE_PIP_NAME }} package."""
+
+import io
+import logging
+import os
+import sys
+
+from os.path import dirname
+from setuptools import find_packages, setup
+
+logger = logging.getLogger(__name__)
+
+version = '{{ RELEASE_NO_LEADING_ZEROS }}{{VERSION_SUFFIX }}'
+
+my_dir = dirname(__file__)
+
+try:
+    with io.open(os.path.join(my_dir,
+                              '{{ PROVIDER_PATH }}/{{ README_FILE }}'),
+                 encoding='utf-8') as f:
+        long_description = f.read()
+except FileNotFoundError:
+    long_description = ''
+
+
+def do_setup(version_suffix_for_pypi=''):
+    """
+    Perform the package setup.
+    """
+    setup(
+        name='{{ PACKAGE_PIP_NAME }}',
+        description='{{ PROVIDER_TYPE }} package {{ PACKAGE_PIP_NAME }} for 
Apache Airflow',
+        long_description=long_description,
+        long_description_content_type='text/markdown',
+        license='Apache License 2.0',
+        version=version + version_suffix_for_pypi,
+        packages=find_packages(
+            include=['airflow.providers.{{ PROVIDER_PACKAGE_ID }}*']),
+        zip_safe=False,
+        install_requires={{ INSTALL_REQUIREMENTS }},
+        setup_requires={{ SETUP_REQUIREMENTS }},
+        extras_require={{ EXTRAS_REQUIREMENTS }},
+        classifiers=[
+            'Development Status :: 5 - Production/Stable',
+            'Environment :: Console',
+            'Environment :: Web Environment',
+            'Intended Audience :: Developers',
+            'Intended Audience :: System Administrators',
+            'License :: OSI Approved :: Apache Software License',
+            'Programming Language :: Python :: 3.6',
+            'Programming Language :: Python :: 3.7',
+            'Programming Language :: Python :: 3.8',
+            'Topic :: System :: Monitoring',
+        ],
+        author='Apache Software Foundation',
+        author_email='d...@airflow.apache.org',
+        url='http://airflow.apache.org/',
+        download_url=(
+            'https://dist.apache.org/repos/dist/release/airflow/{{ 
PROVIDERS_FOLDER }}' + version),
+        python_requires='~=3.6',
+    )
+
+#
+# Note that --version-suffix-for-pypi should only be used in case we generate 
RC packages for PyPI
+# Those packages should have actual RC version in order to be published even 
if source version
+# should be the final one.
+#
+if __name__ == "__main__":
+    suffix=''
+    if len(sys.argv) > 0 and sys.argv[1] == "--version-suffix-for-pypi":

Review comment:
       Argh, sorry, you meant
   ```suggestion
       if len(sys.argv) > 1 and sys.argv[1] == "--version-suffix-for-pypi":
   ```
   
   ```
   Traceback (most recent call last):
     File "setup.py", line 101, in <module>
       if len(sys.argv) > 0 and sys.argv[1] == "--version-suffix-for-pypi":
   IndexError: list index out of range
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to