Skip to content

Commit

Permalink
chore: consolidate the Superset python package metadata
Browse files Browse the repository at this point in the history
Following up on #27859, where
I introduced a new file `pyproject.toml` to set up the
python project metadata, here I'd like to consolidate and modernize
further by pushing as much as possible into pyproject.toml,
except where things need to be dynamic, for which we'll keep using
setup.py:

- get rid of setup.cfg, everything there should be able to move to
  pyproject.toml
- remove duplicate keys from setup.py and pyproject.toml
- minimize/simplify setup.py
  • Loading branch information
mistercrunch committed Apr 10, 2024
1 parent dea4306 commit 27a6b29
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 61 deletions.
31 changes: 30 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ build-backend = "setuptools.build_meta"
name = "apache-superset"
description = "A modern, enterprise-ready business intelligence web application"
readme = "README.md"
dynamic = ["version", "scripts", "entry-points", "license", "requires-python"]
dynamic = ["version", "scripts", "entry-points"]
requires-python = "~=3.9"
license = { file="LICENSE.txt" }
authors = [
{ name = "Apache Software Foundation", email = "[email protected]" },
]
Expand Down Expand Up @@ -197,3 +199,30 @@ development = [
[project.urls]
homepage = "https://superset.apache.org/"
documentation = "https://superset.apache.org/docs/intro"


[tool.isort]
combine_as_imports = true
include_trailing_comma = true
line_length = 88
known_first_party = "superset"
known_third_party = "alembic, apispec, backoff, celery, click, colorama, cron_descriptor, croniter, cryptography, dateutil, deprecation, flask, flask_appbuilder, flask_babel, flask_caching, flask_compress, flask_jwt_extended, flask_login, flask_migrate, flask_sqlalchemy, flask_talisman, flask_testing, flask_wtf, freezegun, geohash, geopy, holidays, humanize, isodate, jinja2, jwt, markdown, markupsafe, marshmallow, msgpack, nh3, numpy, pandas, parameterized, parsedatetime, pgsanity, pkg_resources, polyline, prison, progress, pyarrow, sqlalchemy_bigquery, pyhive, pyparsing, pytest, pytest_mock, pytz, redis, requests, selenium, setuptools, shillelagh, simplejson, slack, sqlalchemy, sqlalchemy_utils, sqlparse, typing_extensions, urllib3, werkzeug, wtforms, wtforms_json, yaml"
multi_line_output = 3
order_by_type = false

[tool.mypy]
check_untyped_defs = true
disallow_any_generics = true
disallow_untyped_calls = true
disallow_untyped_defs = true
ignore_missing_imports = true
no_implicit_optional = true
warn_unused_ignores = true

[tool.mypy."superset.migrations.versions.*"]
ignore_errors = true

[tool.mypy."tests.*"]
check_untyped_defs = false
disallow_untyped_calls = false
disallow_untyped_defs = false
52 changes: 0 additions & 52 deletions setup.cfg

This file was deleted.

9 changes: 1 addition & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
PACKAGE_JSON = os.path.join(BASE_DIR, "superset-frontend", "package.json")


with open(PACKAGE_JSON) as package_file:
version_string = json.load(package_file)["version"]

with open("README.md", encoding="utf-8") as f:
long_description = f.read()


def get_git_sha() -> str:
try:
Expand All @@ -54,10 +52,6 @@ def get_git_sha() -> str:
version_string = version_string.replace("-dev", ".dev0")

setup(
name="apache-superset",
description="A modern, enterprise-ready business intelligence web application",
long_description=long_description,
long_description_content_type="text/markdown",
version=version_string,
packages=find_packages(),
include_package_data=True,
Expand All @@ -75,6 +69,5 @@ def get_git_sha() -> str:
"superset=superset.extensions.metadb:SupersetShillelaghAdapter"
],
},
python_requires="~=3.9",
download_url="https://www.apache.org/dist/superset/" + version_string,
)

0 comments on commit 27a6b29

Please sign in to comment.