You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by el...@apache.org on 2023/06/16 20:54:46 UTC

[superset] 02/02: add instructions and ability to create a dist package for a release candidate

This is an automated email from the ASF dual-hosted git repository.

elizabeth pushed a commit to branch elizabeth/pypi-rc-release
in repository https://gitbox.apache.org/repos/asf/superset.git

commit ae894411873b7cf4b536c13ff76a19bf3d51c990
Author: Elizabeth Thompson <es...@gmail.com>
AuthorDate: Fri Jun 16 13:54:19 2023 -0700

    add instructions and ability to create a dist package for a release candidate
---
 RELEASING/README.md | 44 +++++++++++++++++++++++++++++++++++++++++++-
 setup.py            | 19 +++++++++++++++++--
 2 files changed, 60 insertions(+), 3 deletions(-)

diff --git a/RELEASING/README.md b/RELEASING/README.md
index 901d21aefb..6e40703621 100644
--- a/RELEASING/README.md
+++ b/RELEASING/README.md
@@ -366,7 +366,49 @@ Once 3+ binding votes (by PMC members) have been cast and at
 least 72 hours have past, you can post a [RESULT] thread:
 https://lists.apache.org/thread.html/50a6b134d66b86b237d5d7bc89df1b567246d125a71394d78b45f9a8@%3Cdev.superset.apache.org%3E
 
-To easily send the result email, still on the `superset/RELEASING` directory:
+
+### Publish an RC testing Convenience Pre-Release to PyPI
+
+Extract the release to the `/tmp` folder to build the PiPY release. Files in the `/tmp` folder will be automatically deleted by the OS.
+
+```bash
+mkdir -p /tmp/superset_dev && cd /tmp/superset_dev
+tar xfvz ~/svn/superset_dev/${SUPERSET_VERSION_RC}/${SUPERSET_RELEASE_RC_TARBALL}
+```
+
+Create a virtual environment and install the dependencies
+
+```bash
+cd ${SUPERSET_RELEASE_RC}/
+python3 -m venv venv
+source venv/bin/activate
+pip install -r requirements/base.txt
+pip install twine
+```
+
+Create the distribution
+
+```bash
+cd superset-frontend/
+npm ci && npm run build
+cd ../
+flask fab babel-compile --target superset/translations
+python setup.py sdist --version=${SUPERSET_VERSION_RC}
+```
+
+Publish to PyPI
+
+You may need to ask a fellow committer to grant
+you access to it if you don't have access already. Make sure to create
+an account first if you don't have one, and reference your username
+while requesting access to push packages.
+
+```bash
+twine upload dist/${SUPERSET_RELEASE_RC}.tar.gz
+```
+
+## Sending the result email
+To easily send the result email, on the `superset/RELEASING` directory:
 
 ```bash
 # Note: use Superset's virtualenv
diff --git a/setup.py b/setup.py
index c7c7c18df2..e23699c89d 100644
--- a/setup.py
+++ b/setup.py
@@ -17,14 +17,29 @@
 import json
 import os
 import subprocess
+import sys
 
 from setuptools import find_packages, setup
 
 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"]
+# Get the parameters passed via command line
+parameters = {}
+for arg in sys.argv:
+    if arg.startswith("--"):
+        key, value = arg[2:].split("=")
+        parameters[key] = value
+
+# Access the passed parameters and their values
+version_string = parameters.get("version")
+
+# Remove custom parameters from sys.argv to allow other commands to be processed
+sys.argv = [arg for arg in sys.argv if not arg.startswith('--')]
+
+if not version_string:
+    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()