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 22:57:51 UTC

[superset] branch elizabeth/pypi-rc-release updated (cfb9ba96ef -> b4a6308585)

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

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


    omit cfb9ba96ef add instructions and ability to create a dist package for a release candidate
     new b4a6308585 add instructions and ability to create a dist package for a release candidate

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (cfb9ba96ef)
            \
             N -- N -- N   refs/heads/elizabeth/pypi-rc-release (b4a6308585)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 setup.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)


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

Posted by el...@apache.org.
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 b4a630858536b62816ad3796b33f87190fe6fb6a
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            | 23 +++++++++++++++++++++--
 2 files changed, 64 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..1963f2bdf8 100644
--- a/setup.py
+++ b/setup.py
@@ -17,14 +17,33 @@
 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("--"):
+        try:
+            key, value = arg[2:].split("=")
+            parameters[key] = value
+        except ValueError:
+            # param did not have both a key and a value
+            pass
+
+# 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"] or ""
 
 with open("README.md", encoding="utf-8") as f:
     long_description = f.read()