diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 1781971..9f9af59 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -68,7 +68,7 @@ jobs: run: | md5sum $(which python) > $GITHUB_WORKSPACE/python_cache_key.md5 md5sum e2e_playwright/test-requirements.txt >> $GITHUB_WORKSPACE/python_cache_key.md5 - md5sum setup.py >> $GITHUB_WORKSPACE/python_cache_key.md5 + md5sum pyproject.toml >> $GITHUB_WORKSPACE/python_cache_key.md5 date +%F >> $GITHUB_WORKSPACE/python_cache_key.md5 shell: bash - name: Restore virtualenv from cache @@ -81,8 +81,8 @@ jobs: run: | python -m venv venv source venv/bin/activate - pip install setuptools - python setup.py sdist bdist_wheel + pip install build + python -m build - name: Install Python test dependencies run: | source venv/bin/activate diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a2cc3b..2b4fc5a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -96,7 +96,7 @@ jobs: run: | md5sum $(which python) > $GITHUB_WORKSPACE/python_cache_key.md5 md5sum e2e_playwright/test-requirements.txt >> $GITHUB_WORKSPACE/python_cache_key.md5 - md5sum setup.py >> $GITHUB_WORKSPACE/python_cache_key.md5 + md5sum pyproject.toml >> $GITHUB_WORKSPACE/python_cache_key.md5 date +%F >> $GITHUB_WORKSPACE/python_cache_key.md5 shell: bash @@ -111,8 +111,8 @@ jobs: run: | python -m venv venv source venv/bin/activate - pip install setuptools - python setup.py sdist bdist_wheel + pip install build + python -m build - name: Store Package uses: actions/upload-artifact@v4 diff --git a/MANIFEST.in b/MANIFEST.in index 9eac5f2..1588511 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,2 @@ -recursive-include streamlit_bokeh/frontend/build * \ No newline at end of file +recursive-include streamlit_bokeh/frontend/build * +prune streamlit_bokeh/frontend/node_modules diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..16220ea --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,69 @@ +# Copyright (c) Snowflake Inc. (2025) +# +# Licensed 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. + +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "streamlit-bokeh" +version = "3.8.0" +description = "Streamlit component that allows you to render Bokeh charts" +readme = "README.md" +license = "Apache-2.0" +license-files = ["LICENSE"] +authors = [{ name = "Snowflake Inc", email = "hello@streamlit.io" }] +requires-python = ">=3.9" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: Scientific/Engineering :: Visualization", +] +dependencies = ["streamlit>=1.26", "bokeh==3.8.0"] + +[project.optional-dependencies] +devel = [ + "wheel", + "pytest==7.4.0", + "playwright==1.48.0", + "requests==2.31.0", + "pytest-playwright-snapshot==1.0", + "pytest-rerunfailures==12.0", +] + +[project.urls] +Homepage = "https://streamlit.io" +"Source Code" = "https://github.com/streamlit/streamlit-bokeh" +"Bug Tracker" = "https://github.com/streamlit/streamlit/issues" +Community = "https://discuss.streamlit.io/" +Twitter = "https://twitter.com/streamlit" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +where = ["."] +include = ["streamlit_bokeh*"] +exclude = ["e2e_playwright*", "scripts*", "build*", "dist*", "venv*", ".*"] + +[tool.setuptools.package-data] +streamlit_bokeh = ["frontend/build/**/*", "pyproject.toml"] diff --git a/setup.py b/setup.py deleted file mode 100644 index 5745ca0..0000000 --- a/setup.py +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright (c) Snowflake Inc. (2025) -# -# Licensed 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. - -from pathlib import Path - -import setuptools - -this_directory = Path(__file__).parent -long_description = (this_directory / "README.md").read_text() - -setuptools.setup( - name="streamlit-bokeh", - version="3.8.0", - author="Snowflake Inc", - author_email="hello@streamlit.io", - description="Streamlit component that allows you to render Bokeh charts", - long_description=long_description, - long_description_content_type="text/markdown", - project_urls={ - "Source Code": "https://github.com/streamlit/streamlit-bokeh", - "Bug Tracker": "https://github.com/streamlit/streamlit/issues", - "Community": "https://discuss.streamlit.io/", - "Twitter": "https://twitter.com/streamlit", - }, - url="https://streamlit.io", - license="Apache License 2.0", - packages=setuptools.find_packages(), - include_package_data=True, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Console", - "Environment :: Web Environment", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Topic :: Scientific/Engineering :: Visualization", - ], - python_requires=">=3.9", - install_requires=[ - # By definition, a Custom Component depends on Streamlit. - # If your component has other Python dependencies, list - # them here. - "streamlit>=1.26", - "bokeh==3.8.0", - ], - extras_require={ - "devel": [ - "wheel", - "pytest==7.4.0", - "playwright==1.48.0", - "requests==2.31.0", - "pytest-playwright-snapshot==1.0", - "pytest-rerunfailures==12.0", - ] - }, -)