1
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024)
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
7
# http://www.apache.org/licenses/LICENSE-2.0
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.
17
from pathlib import Path
19
from setuptools import find_packages, setup
20
from setuptools.command.install import install
22
THIS_DIRECTORY = Path(__file__).parent
24
VERSION = "1.32.0" # PEP-440
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
34
"cachetools>=4.0, <6",
37
"packaging>=16.8, <24",
38
# Lowest version with available wheel for 3.7 + amd64 + linux
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.)
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
52
"tenacity>=8.1.0, <9",
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'",
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).
72
if not os.getenv("SNOWPARK_CONDA_BUILD"):
73
INSTALL_REQUIRES.extend(SNOWPARK_CONDA_EXCLUDED_DEPENDENCIES)
77
"snowflake-snowpark-python>=0.9.0; python_version=='3.8'",
78
"snowflake-connector-python>=2.8.0; python_version=='3.8'",
83
class VerifyVersionCommand(install):
84
"""Custom command to verify that the git tag matches our version"""
86
description = "verify that the git tag matches our version"
89
tag = os.getenv("TAG")
92
info = "Git tag: {0} does not match the version of this app: {1}".format(
98
readme_path = THIS_DIRECTORY / ".." / "README.md"
99
if readme_path.exists():
100
long_description = readme_path.read_text()
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 = ""
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",
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",
123
author="Snowflake Inc",
124
author_email="hello@streamlit.io",
125
license="Apache License 2.0",
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",
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.*"]),
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
161
scripts=["bin/streamlit.cmd"],
163
"verify": VerifyVersionCommand,