Skip to content

Commit 6e02d19

Browse files
fix: make packages PEP 625 compliant (#32866)
Co-authored-by: Michael S. Molina <michael.s.molina@gmail.com>
1 parent 662f0fa commit 6e02d19

19 files changed

+59
-53
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ ghostdriver.log
107107
testCSV.csv
108108
.terser-plugin-cache/
109109
apache-superset-*.tar.gz*
110+
apache_superset-*.tar.gz*
110111
release.json
111112

112113
# Translation-related files

README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ under the License.
2222
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0)
2323
[![Latest Release on Github](https://img.shields.io/github/v/release/apache/superset?sort=semver)](https://github.com/apache/superset/releases/latest)
2424
[![Build Status](https://github.com/apache/superset/actions/workflows/superset-python-unittest.yml/badge.svg)](https://github.com/apache/superset/actions)
25-
[![PyPI version](https://badge.fury.io/py/apache-superset.svg)](https://badge.fury.io/py/apache-superset)
25+
[![PyPI version](https://badge.fury.io/py/apache_superset.svg)](https://badge.fury.io/py/apache_superset)
2626
[![Coverage Status](https://codecov.io/github/apache/superset/coverage.svg?branch=master)](https://codecov.io/github/apache/superset)
27-
[![PyPI](https://img.shields.io/pypi/pyversions/apache-superset.svg?maxAge=2592000)](https://pypi.python.org/pypi/apache-superset)
27+
[![PyPI](https://img.shields.io/pypi/pyversions/apache_superset.svg?maxAge=2592000)](https://pypi.python.org/pypi/apache_superset)
2828
[![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](http://bit.ly/join-superset-slack)
2929
[![Documentation](https://img.shields.io/badge/docs-apache.org-blue.svg)](https://superset.apache.org)
3030

@@ -72,9 +72,10 @@ Superset provides:
7272
## Screenshots & Gifs
7373

7474
**Video Overview**
75+
7576
<!-- File hosted here https://github.com/apache/superset-site/raw/lfs/superset-video-4k.mp4 -->
76-
[superset-video-1080p.webm](https://github.com/user-attachments/assets/b37388f7-a971-409c-96a7-90c4e31322e6)
7777

78+
[superset-video-1080p.webm](https://github.com/user-attachments/assets/b37388f7-a971-409c-96a7-90c4e31322e6)
7879

7980
<br/>
8081

@@ -156,7 +157,7 @@ Try out Superset's [quickstart](https://superset.apache.org/docs/quickstart/) gu
156157
and please read our [Slack Community Guidelines](https://github.com/apache/superset/blob/master/CODE_OF_CONDUCT.md#slack-community-guidelines)
157158
- [Join our dev@superset.apache.org Mailing list](https://lists.apache.org/list.html?dev@superset.apache.org). To join, simply send an email to [dev-subscribe@superset.apache.org](mailto:dev-subscribe@superset.apache.org)
158159
- If you want to help troubleshoot GitHub Issues involving the numerous database drivers that Superset supports, please consider adding your name and the databases you have access to on the [Superset Database Familiarity Rolodex](https://docs.google.com/spreadsheets/d/1U1qxiLvOX0kBTUGME1AHHi6Ywel6ECF8xk_Qy-V9R8c/edit#gid=0)
159-
- Join Superset's Town Hall and [Operational Model](https://preset.io/blog/the-superset-operational-model-wants-you/) recurring meetings. Meeting info is available on the [Superset Community Calendar](https://superset.apache.org/community)
160+
- Join Superset's Town Hall and [Operational Model](https://preset.io/blog/the-superset-operational-model-wants-you/) recurring meetings. Meeting info is available on the [Superset Community Calendar](https://superset.apache.org/community)
160161

161162
## Contributor Guide
162163

@@ -184,21 +185,24 @@ Understanding the Superset Points of View
184185
- [Building New Database Connectors](https://preset.io/blog/building-database-connector/)
185186
- [Create Your First Dashboard](https://superset.apache.org/docs/using-superset/creating-your-first-dashboard/)
186187
- [Comprehensive Tutorial for Contributing Code to Apache Superset
187-
](https://preset.io/blog/tutorial-contributing-code-to-apache-superset/)
188+
](https://preset.io/blog/tutorial-contributing-code-to-apache-superset/)
188189
- [Resources to master Superset by Preset](https://preset.io/resources/)
189190

190191
- Deploying Superset
192+
191193
- [Official Docker image](https://hub.docker.com/r/apache/superset)
192194
- [Helm Chart](https://github.com/apache/superset/tree/master/helm/superset)
193195

194196
- Recordings of Past [Superset Community Events](https://preset.io/events)
197+
195198
- [Mixed Time Series Charts](https://preset.io/events/mixed-time-series-visualization-in-superset-workshop/)
196199
- [How the Bing Team Customized Superset for the Internal Self-Serve Data & Analytics Platform](https://preset.io/events/how-the-bing-team-heavily-customized-superset-for-their-internal-data/)
197200
- [Live Demo: Visualizing MongoDB and Pinot Data using Trino](https://preset.io/events/2021-04-13-visualizing-mongodb-and-pinot-data-using-trino/)
198201
- [Introduction to the Superset API](https://preset.io/events/introduction-to-the-superset-api/)
199202
- [Building a Database Connector for Superset](https://preset.io/events/2021-02-16-building-a-database-connector-for-superset/)
200203

201204
- Visualizations
205+
202206
- [Creating Viz Plugins](https://superset.apache.org/docs/contributing/creating-viz-plugins/)
203207
- [Managing and Deploying Custom Viz Plugins](https://medium.com/nmc-techblog/apache-superset-manage-custom-viz-plugins-in-production-9fde1a708e55)
204208
- [Why Apache Superset is Betting on Apache ECharts](https://preset.io/blog/2021-4-1-why-echarts/)

RELEASING/Dockerfile.from_local_tarball

+13-13
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN useradd --user-group --create-home --no-log-init --shell /bin/bash superset
2020

2121
# Configure environment
2222
ENV LANG=C.UTF-8 \
23-
LC_ALL=C.UTF-8
23+
LC_ALL=C.UTF-8
2424

2525
RUN apt-get update -y
2626

@@ -30,14 +30,14 @@ RUN apt-get install -y apt-transport-https apt-utils
3030
# Install superset dependencies
3131
# https://superset.apache.org/docs/installation/installing-superset-from-scratch
3232
RUN apt-get install -y build-essential libssl-dev \
33-
libffi-dev python3-dev libsasl2-dev libldap2-dev libxi-dev chromium zstd
33+
libffi-dev python3-dev libsasl2-dev libldap2-dev libxi-dev chromium zstd
3434

3535
# Install nodejs for custom build
3636
# https://nodejs.org/en/download/package-manager/
3737
RUN set -eux; \
38-
curl -sL https://deb.nodesource.com/setup_20.x | bash -; \
39-
apt-get install -y nodejs; \
40-
node --version;
38+
curl -sL https://deb.nodesource.com/setup_20.x | bash -; \
39+
apt-get install -y nodejs; \
40+
node --version;
4141
RUN if ! which npm; then apt-get install -y npm; fi
4242

4343
RUN mkdir -p /home/superset
@@ -50,21 +50,21 @@ ARG SUPERSET_RELEASE_RC_TARBALL
5050
# Can fetch source from svn or copy tarball from local mounted directory
5151
COPY $SUPERSET_RELEASE_RC_TARBALL ./
5252
RUN tar -xvf *.tar.gz
53-
WORKDIR /home/superset/apache-superset-$VERSION/superset-frontend
53+
WORKDIR /home/superset/apache_superset-$VERSION/superset-frontend
5454

5555
RUN npm ci \
56-
&& npm run build \
57-
&& rm -rf node_modules
56+
&& npm run build \
57+
&& rm -rf node_modules
5858

59-
WORKDIR /home/superset/apache-superset-$VERSION
59+
WORKDIR /home/superset/apache_superset-$VERSION
6060
RUN pip install --upgrade setuptools pip \
61-
&& pip install -r requirements/base.txt \
62-
&& pip install --no-cache-dir .
61+
&& pip install -r requirements/base.txt \
62+
&& pip install --no-cache-dir .
6363

6464
RUN flask fab babel-compile --target superset/translations
6565

6666
ENV PATH=/home/superset/superset/bin:$PATH \
67-
PYTHONPATH=/home/superset/superset/ \
68-
SUPERSET_TESTENV=true
67+
PYTHONPATH=/home/superset/superset/ \
68+
SUPERSET_TESTENV=true
6969
COPY from_tarball_entrypoint.sh /entrypoint.sh
7070
ENTRYPOINT ["/entrypoint.sh"]

RELEASING/Dockerfile.from_svn_tarball

+12-12
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN useradd --user-group --create-home --no-log-init --shell /bin/bash superset
2020

2121
# Configure environment
2222
ENV LANG=C.UTF-8 \
23-
LC_ALL=C.UTF-8
23+
LC_ALL=C.UTF-8
2424

2525
RUN apt-get update -y
2626

@@ -30,14 +30,14 @@ RUN apt-get install -y apt-transport-https apt-utils
3030
# Install superset dependencies
3131
# https://superset.apache.org/docs/installation/installing-superset-from-scratch
3232
RUN apt-get install -y subversion build-essential libssl-dev \
33-
libffi-dev python3-dev libsasl2-dev libldap2-dev libxi-dev chromium zstd
33+
libffi-dev python3-dev libsasl2-dev libldap2-dev libxi-dev chromium zstd
3434

3535
# Install nodejs for custom build
3636
# https://nodejs.org/en/download/package-manager/
3737
RUN set -eux; \
38-
curl -sL https://deb.nodesource.com/setup_20.x | bash -; \
39-
apt-get install -y nodejs; \
40-
node --version;
38+
curl -sL https://deb.nodesource.com/setup_20.x | bash -; \
39+
apt-get install -y nodejs; \
40+
node --version;
4141
RUN if ! which npm; then apt-get install -y npm; fi
4242

4343
RUN mkdir -p /home/superset
@@ -49,20 +49,20 @@ ARG VERSION
4949
# Can fetch source from svn or copy tarball from local mounted directory
5050
RUN svn co https://dist.apache.org/repos/dist/dev/superset/$VERSION ./
5151
RUN tar -xvf *.tar.gz
52-
WORKDIR /home/superset/apache-superset-$VERSION/superset-frontend
52+
WORKDIR /home/superset/apache_superset-$VERSION/superset-frontend
5353

5454
RUN npm ci \
55-
&& npm run build \
56-
&& rm -rf node_modules
55+
&& npm run build \
56+
&& rm -rf node_modules
5757

58-
WORKDIR /home/superset/apache-superset-$VERSION
58+
WORKDIR /home/superset/apache_superset-$VERSION
5959
RUN pip install --upgrade setuptools pip \
60-
&& pip install -r requirements/base.txt \
61-
&& pip install --no-cache-dir .
60+
&& pip install -r requirements/base.txt \
61+
&& pip install --no-cache-dir .
6262

6363
RUN flask fab babel-compile --target superset/translations
6464

6565
ENV PATH=/home/superset/superset/bin:$PATH \
66-
PYTHONPATH=/home/superset/superset/
66+
PYTHONPATH=/home/superset/superset/
6767
COPY from_tarball_entrypoint.sh /entrypoint.sh
6868
ENTRYPOINT ["/entrypoint.sh"]

RELEASING/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ SUPERSET_RC=1
123123
SUPERSET_GITHUB_BRANCH=1.5
124124
SUPERSET_PGP_FULLNAME=villebro@apache.org
125125
SUPERSET_VERSION_RC=1.5.1rc1
126-
SUPERSET_RELEASE=apache-superset-1.5.1
127-
SUPERSET_RELEASE_RC=apache-superset-1.5.1rc1
128-
SUPERSET_RELEASE_TARBALL=apache-superset-1.5.1-source.tar.gz
129-
SUPERSET_RELEASE_RC_TARBALL=apache-superset-1.5.1rc1-source.tar.gz
126+
SUPERSET_RELEASE=apache_superset-1.5.1
127+
SUPERSET_RELEASE_RC=apache_superset-1.5.1rc1
128+
SUPERSET_RELEASE_TARBALL=apache_superset-1.5.1-source.tar.gz
129+
SUPERSET_RELEASE_RC_TARBALL=apache_superset-1.5.1rc1-source.tar.gz
130130
SUPERSET_TMP_ASF_SITE_PATH=/tmp/incubator-superset-site-1.5.1
131131
-------------------------------
132132
```
@@ -380,7 +380,7 @@ Official instructions:
380380
https://www.apache.org/info/verification.html
381381

382382
We now have a handy script for anyone validating a release to use. The core of it is in this very folder, `verify_release.py`. Just make sure you have all three release files in the same directory (`{some version}.tar.gz`, `{some version}.tar.gz.asc` and `{some version}tar.gz.sha512`). Then you can pass this script the path to the `.gz` file like so:
383-
`python verify_release.py ~/path/tp/apache-superset-{version/candidate}-source.tar.gz`
383+
`python verify_release.py ~/path/tp/apache_superset-{version/candidate}-source.tar.gz`
384384

385385
If all goes well, you will see this result in your terminal:
386386

@@ -470,7 +470,7 @@ while requesting access to push packages.
470470

471471
```bash
472472
twine upload dist/apache_superset-${SUPERSET_VERSION}-py3-none-any.whl
473-
twine upload dist/apache-superset-${SUPERSET_VERSION}.tar.gz
473+
twine upload dist/apache_superset-${SUPERSET_VERSION}.tar.gz
474474
```
475475

476476
Set your username to `__token__`

RELEASING/email_templates/announce.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The official source release:
3131
https://downloads.apache.org/{{ project_module }}/{{ version }}
3232

3333
The PyPI package:
34-
https://pypi.org/project/apache-superset/{{ version }}
34+
https://pypi.org/project/apache_superset/{{ version }}
3535

3636
The CHANGELOG for the release:
3737
https://github.com/apache/{{ project_module }}/blob/{{ version }}/CHANGELOG/{{ version }}.md

RELEASING/make_tarball.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ else
3232
SUPERSET_VERSION="${1}"
3333
SUPERSET_RC="${2}"
3434
SUPERSET_PGP_FULLNAME="${3}"
35-
SUPERSET_RELEASE_RC_TARBALL="apache-superset-${SUPERSET_VERSION_RC}-source.tar.gz"
35+
SUPERSET_RELEASE_RC_TARBALL="apache_superset-${SUPERSET_VERSION_RC}-source.tar.gz"
3636
fi
3737

3838
SUPERSET_VERSION_RC="${SUPERSET_VERSION}rc${SUPERSET_RC}"

RELEASING/make_tarball_entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if [ -z "${SUPERSET_VERSION_RC}" ] || [ -z "${SUPERSET_SVN_DEV_PATH}" ] || [ -z
2222
exit 1
2323
fi
2424

25-
SUPERSET_RELEASE_RC=apache-superset-"${SUPERSET_VERSION_RC}"
25+
SUPERSET_RELEASE_RC=apache_superset-"${SUPERSET_VERSION_RC}"
2626
SUPERSET_RELEASE_RC_TARBALL="${SUPERSET_RELEASE_RC}"-source.tar.gz
2727
SUPERSET_RELEASE_RC_BASE_PATH="${SUPERSET_SVN_DEV_PATH}"/"${SUPERSET_VERSION_RC}"
2828
SUPERSET_RELEASE_RC_TARBALL_PATH="${SUPERSET_RELEASE_RC_BASE_PATH}"/"${SUPERSET_RELEASE_RC_TARBALL}"

RELEASING/set_release_env.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ else
5050
export SUPERSET_GITHUB_BRANCH="${VERSION_MAJOR}.${VERSION_MINOR}"
5151
export SUPERSET_PGP_FULLNAME="${2}"
5252
export SUPERSET_VERSION_RC="${SUPERSET_VERSION}rc${VERSION_RC}"
53-
export SUPERSET_RELEASE=apache-superset-"${SUPERSET_VERSION}"
54-
export SUPERSET_RELEASE_RC=apache-superset-"${SUPERSET_VERSION_RC}"
53+
export SUPERSET_RELEASE=apache_superset-"${SUPERSET_VERSION}"
54+
export SUPERSET_RELEASE_RC=apache_superset-"${SUPERSET_VERSION_RC}"
5555
export SUPERSET_RELEASE_TARBALL="${SUPERSET_RELEASE}"-source.tar.gz
5656
export SUPERSET_RELEASE_RC_TARBALL="${SUPERSET_RELEASE_RC}"-source.tar.gz
5757
export SUPERSET_TMP_ASF_SITE_PATH="/tmp/incubator-superset-site-${SUPERSET_VERSION}"

RELEASING/test_run_tarball.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if [ -z "${SUPERSET_SVN_DEV_PATH}" ]; then
2727
fi
2828

2929
if [[ -n ${1} ]] && [[ ${1} == "local" ]]; then
30-
SUPERSET_RELEASE_RC=apache-superset-"${SUPERSET_VERSION_RC}"
30+
SUPERSET_RELEASE_RC=apache_superset-"${SUPERSET_VERSION_RC}"
3131
SUPERSET_RELEASE_RC_TARBALL="${SUPERSET_RELEASE_RC}"-source.tar.gz
3232
SUPERSET_TARBALL_PATH="${SUPERSET_SVN_DEV_PATH}"/${SUPERSET_VERSION_RC}/${SUPERSET_RELEASE_RC_TARBALL}
3333
SUPERSET_TMP_TARBALL_FILENAME=_tmp_"${SUPERSET_VERSION_RC}".tar.gz

RELEASING/validate_this_release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ get_pip_command() {
3838
PYTHON=$(get_python_command)
3939
PIP=$(get_pip_command)
4040

41-
# Get the release directory's path. If you unzip an Apache release and just run the npm script to validate the release, this will be a file name like `apache-superset-x.x.xrcx-source.tar.gz`
41+
# Get the release directory's path. If you unzip an Apache release and just run the npm script to validate the release, this will be a file name like `apache_superset-x.x.xrcx-source.tar.gz`
4242
RELEASE_ZIP_PATH="../../$(basename "$(dirname "$(pwd)")")-source.tar.gz"
4343

4444
# Install dependencies from requirements.txt if the file exists

docs/docs/configuration/databases.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ are compatible with Superset.
7272
| [PostgreSQL](/docs/configuration/databases#postgres) | `pip install psycopg2` | `postgresql://<UserName>:<DBPassword>@<Database Host>/<Database Name>` |
7373
| [Presto](/docs/configuration/databases#presto) | `pip install pyhive` | `presto://{username}:{password}@{hostname}:{port}/{database}` |
7474
| [Rockset](/docs/configuration/databases#rockset) | `pip install rockset-sqlalchemy` | `rockset://<api_key>:@<api_server>` |
75-
| [SAP Hana](/docs/configuration/databases#hana) | `pip install hdbcli sqlalchemy-hana` or `pip install apache-superset[hana]` | `hana://{username}:{password}@{host}:{port}` |
75+
| [SAP Hana](/docs/configuration/databases#hana) | `pip install hdbcli sqlalchemy-hana` or `pip install apache_superset[hana]` | `hana://{username}:{password}@{host}:{port}` |
7676
| [StarRocks](/docs/configuration/databases#starrocks) | `pip install starrocks` | `starrocks://<User>:<Password>@<Host>:<Port>/<Catalog>.<Database>` |
7777
| [Snowflake](/docs/configuration/databases#snowflake) | `pip install snowflake-sqlalchemy` | `snowflake://{user}:{password}@{account}.{region}/{database}?role={role}&warehouse={warehouse}` |
7878
| SQLite | No additional library needed | `sqlite://path/to/file.db?check_same_thread=false` |

docs/docs/configuration/networking-settings.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ version: 1
1111
To configure CORS, or cross-origin resource sharing, the following dependency must be installed:
1212

1313
```python
14-
pip install apache-superset[cors]
14+
pip install apache_superset[cors]
1515
```
1616

1717
The following keys in `superset_config.py` can be specified to configure CORS:

docs/docs/contributing/contributing.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ More references:
2626
Here's a list of repositories that contain Superset-related packages:
2727

2828
- [apache/superset](https://github.com/apache/superset)
29-
is the main repository containing the `apache-superset` Python package
29+
is the main repository containing the `apache_superset` Python package
3030
distributed on
31-
[pypi](https://pypi.org/project/apache-superset/). This repository
31+
[pypi](https://pypi.org/project/apache_superset/). This repository
3232
also includes Superset's main TypeScript/JavaScript bundles and react apps under
3333
the [superset-frontend](https://github.com/apache/superset/tree/master/superset-frontend)
3434
folder.

docs/docs/installation/pypi.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import useBaseUrl from "@docusaurus/useBaseUrl";
1212
<img src={useBaseUrl("/img/pypi.png" )} width="150" />
1313
<br /><br />
1414

15-
This page describes how to install Superset using the `apache-superset` package [published on PyPI](https://pypi.org/project/apache-superset/).
15+
This page describes how to install Superset using the `apache_superset` package [published on PyPI](https://pypi.org/project/apache_superset/).
1616

1717
## OS Dependencies
1818

@@ -124,10 +124,10 @@ command line.
124124

125125
### Installing and Initializing Superset
126126

127-
First, start by installing `apache-superset`:
127+
First, start by installing `apache_superset`:
128128

129129
```bash
130-
pip install apache-superset
130+
pip install apache_superset
131131
```
132132

133133
Then, define mandatory configurations, SECRET_KEY and FLASK_APP:

docs/docs/installation/upgrading-superset.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ docker compose up
3232
To upgrade superset in a native installation, run the following commands:
3333

3434
```bash
35-
pip install apache-superset --upgrade
35+
pip install apache_superset --upgrade
3636
```
3737

3838
## Upgrading the Metadata Database

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ requires = ["setuptools>=40.9.0", "wheel"]
2020
build-backend = "setuptools.build_meta"
2121

2222
[project]
23-
name = "apache-superset"
23+
name = "apache_superset"
2424
description = "A modern, enterprise-ready business intelligence web application"
2525
readme = "README.md"
2626
dynamic = ["version", "scripts", "entry-points"]

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def get_git_sha() -> str:
5252
version_string = version_string.replace("-dev", ".dev0")
5353

5454
setup(
55+
name="apache_superset",
5556
version=version_string,
5657
packages=find_packages(),
5758
include_package_data=True,

superset/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ class D3TimeFormat(TypedDict, total=False):
818818

819819
# CORS Options
820820
# NOTE: enabling this requires installing the cors-related python dependencies
821-
# `pip install .[cors]` or `pip install apache-superset[cors]`, depending
821+
# `pip install .[cors]` or `pip install apache_superset[cors]`, depending
822822
ENABLE_CORS = False
823823
CORS_OPTIONS: dict[Any, Any] = {}
824824

0 commit comments

Comments
 (0)