streamlit

Форк
0
/
setup.py 
165 строк · 6.6 Кб
1
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024)
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
6
#
7
#     http://www.apache.org/licenses/LICENSE-2.0
8
#
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14

15
import os
16
import sys
17
from pathlib import Path
18

19
from setuptools import find_packages, setup
20
from setuptools.command.install import install
21

22
THIS_DIRECTORY = Path(__file__).parent
23

24
VERSION = "1.32.0"  # PEP-440
25

26
# IMPORTANT: We should try very hard *not* to add dependencies to Streamlit.
27
# And if you do add one, make the required version as general as possible:
28
# - Include relevant lower bound for any features we use from our dependencies
29
# - Always include the lower bound as >= VERSION, to keep testing min versions easy
30
# - And include an upper bound that's < NEXT_MAJOR_VERSION
31
INSTALL_REQUIRES = [
32
    "altair>=4.0, <6",
33
    "blinker>=1.0.0, <2",
34
    "cachetools>=4.0, <6",
35
    "click>=7.0, <9",
36
    "numpy>=1.19.3, <2",
37
    "packaging>=16.8, <24",
38
    # Lowest version with available wheel for 3.7 + amd64 + linux
39
    "pandas>=1.3.0, <3",
40
    "pillow>=7.1.0, <11",
41
    # Python protobuf 4.21 (the first 4.x version) is compatible with protobufs
42
    # generated from `protoc` >= 3.20. (`protoc` is installed separately from the Python
43
    # protobuf package, so this pin doesn't actually enforce a `protoc` minimum version.
44
    # Instead, the `protoc` min version is enforced in our Makefile.)
45
    "protobuf>=3.20, <5",
46
    # pyarrow is not semantically versioned, gets new major versions frequently, and
47
    # doesn't tend to break the API on major version upgrades, so we don't put an
48
    # upper bound on it.
49
    "pyarrow>=7.0",
50
    "requests>=2.27, <3",
51
    "rich>=10.14.0, <14",
52
    "tenacity>=8.1.0, <9",
53
    "toml>=0.10.1, <2",
54
    "typing-extensions>=4.3.0, <5",
55
    # Don't require watchdog on MacOS, since it'll fail without xcode tools.
56
    # Without watchdog, we fallback to a polling file watcher to check for app changes.
57
    "watchdog>=2.1.5; platform_system != 'Darwin'",
58
]
59

60
# We want to exclude some dependencies in our internal Snowpark conda distribution of
61
# Streamlit. These dependencies will be installed normally for both regular conda builds
62
# and PyPI builds (that is, for people installing streamlit using either
63
# `pip install streamlit` or `conda install -c conda-forge streamlit`)
64
SNOWPARK_CONDA_EXCLUDED_DEPENDENCIES = [
65
    "gitpython>=3.0.7, <4, !=3.1.19",
66
    "pydeck>=0.8.0b4, <1",
67
    # Tornado 6.0.3 was the current Tornado version when Python 3.8, our earliest supported Python version,
68
    # was released (Oct 14, 2019).
69
    "tornado>=6.0.3, <7",
70
]
71

72
if not os.getenv("SNOWPARK_CONDA_BUILD"):
73
    INSTALL_REQUIRES.extend(SNOWPARK_CONDA_EXCLUDED_DEPENDENCIES)
74

75
EXTRA_REQUIRES = {
76
    "snowflake": [
77
        "snowflake-snowpark-python>=0.9.0; python_version=='3.8'",
78
        "snowflake-connector-python>=2.8.0; python_version=='3.8'",
79
    ]
80
}
81

82

83
class VerifyVersionCommand(install):
84
    """Custom command to verify that the git tag matches our version"""
85

86
    description = "verify that the git tag matches our version"
87

88
    def run(self):
89
        tag = os.getenv("TAG")
90

91
        if tag != VERSION:
92
            info = "Git tag: {0} does not match the version of this app: {1}".format(
93
                tag, VERSION
94
            )
95
            sys.exit(info)
96

97

98
readme_path = THIS_DIRECTORY / ".." / "README.md"
99
if readme_path.exists():
100
    long_description = readme_path.read_text()
101
else:
102
    # In some build environments (specifically in conda), we may not have the README file
103
    # readily available. In these cases, just let long_description be the empty string.
104
    # Note that long_description isn't used at all in these build environments, so it
105
    # being missing isn't problematic.
106
    long_description = ""
107

108
setup(
109
    name="streamlit",
110
    version=VERSION,
111
    description="A faster way to build and share data apps",
112
    long_description=long_description,
113
    long_description_content_type="text/markdown",
114
    url="https://streamlit.io",
115
    project_urls={
116
        "Source Code": "https://github.com/streamlit/streamlit",
117
        "Bug Tracker": "https://github.com/streamlit/streamlit/issues",
118
        "Release notes": "https://docs.streamlit.io/library/changelog",
119
        "Documentation": "https://docs.streamlit.io/",
120
        "Community": "https://discuss.streamlit.io/",
121
        "Twitter": "https://twitter.com/streamlit",
122
    },
123
    author="Snowflake Inc",
124
    author_email="hello@streamlit.io",
125
    license="Apache License 2.0",
126
    classifiers=[
127
        "Development Status :: 5 - Production/Stable",
128
        "Environment :: Console",
129
        "Environment :: Web Environment",
130
        "Intended Audience :: Developers",
131
        "Intended Audience :: Science/Research",
132
        "License :: OSI Approved :: Apache Software License",
133
        "Programming Language :: Python :: 3.8",
134
        "Programming Language :: Python :: 3.9",
135
        "Programming Language :: Python :: 3.10",
136
        "Programming Language :: Python :: 3.11",
137
        "Programming Language :: Python :: 3.12",
138
        "Topic :: Database :: Front-Ends",
139
        "Topic :: Office/Business :: Financial :: Spreadsheet",
140
        "Topic :: Scientific/Engineering :: Information Analysis",
141
        "Topic :: Scientific/Engineering :: Visualization",
142
        "Topic :: Software Development :: Libraries :: Application Frameworks",
143
        "Topic :: Software Development :: Widget Sets",
144
    ],
145
    # We exclude Python 3.9.7 from our compatible versions due to a bug in that version
146
    # with typing.Protocol. See https://github.com/streamlit/streamlit/issues/5140 and
147
    # https://bugs.python.org/issue45121
148
    python_requires=">=3.8, !=3.9.7",
149
    # PEP 561: https://mypy.readthedocs.io/en/stable/installed_packages.html
150
    package_data={"streamlit": ["py.typed", "hello/**/*.py"]},
151
    packages=find_packages(exclude=["tests", "tests.*"]),
152
    # Requirements
153
    install_requires=INSTALL_REQUIRES,
154
    extras_require=EXTRA_REQUIRES,
155
    zip_safe=False,  # install source files not egg
156
    include_package_data=True,  # copy html and friends
157
    entry_points={"console_scripts": ["streamlit = streamlit.web.cli:main"]},
158
    # For Windows so that streamlit * commands work ie.
159
    # - streamlit version
160
    # - streamlit hello
161
    scripts=["bin/streamlit.cmd"],
162
    cmdclass={
163
        "verify": VerifyVersionCommand,
164
    },
165
)
166

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.