From 452157ee3b900ef6e339e2324775e4e587166d23 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 12:25:12 +0100 Subject: [PATCH 01/15] maint(release): make release script headless --- release/aptinstall.sh | 13 +++---------- release/ci_release_script.sh | 12 ++++++++++++ release/compare_tar_against_git.py | 1 + 3 files changed, 16 insertions(+), 10 deletions(-) create mode 100755 release/ci_release_script.sh diff --git a/release/aptinstall.sh b/release/aptinstall.sh index bbe098b90e19..a4ae221df318 100755 --- a/release/aptinstall.sh +++ b/release/aptinstall.sh @@ -2,10 +2,10 @@ set -o errexit -sudo add-apt-repository ppa:deadsnakes/ppa +sudo add-apt-repository -y ppa:deadsnakes/ppa sudo apt update -sudo apt install\ +sudo apt install -y\ antlr4\ libgfortran5\ python3-venv\ @@ -26,7 +26,7 @@ sudo apt install\ gfortran\ # -sudo apt install\ +sudo apt install -y\ python3.6\ python3.6-venv\ python3.7\ @@ -34,10 +34,3 @@ sudo apt install\ python3.9\ python3.9-venv\ # python3.8 is installed by default in 20.04 - -python3 -m venv release/venv_main -source release/venv_main/bin/activate - -pip install -U pip wheel -pip install -r release/requirements.txt -pip install -e . diff --git a/release/ci_release_script.sh b/release/ci_release_script.sh new file mode 100755 index 000000000000..09f4e5cc6b6e --- /dev/null +++ b/release/ci_release_script.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +release/aptinstall.sh + +python3 -m venv release/venv_main +source release/venv_main/bin/activate + +pip install -U pip wheel +pip install -r release/requirements.txt +pip install -e . + +python release/releasecheck.py $1 release-$1 diff --git a/release/compare_tar_against_git.py b/release/compare_tar_against_git.py index c29fb4560e19..6fb64d610e10 100755 --- a/release/compare_tar_against_git.py +++ b/release/compare_tar_against_git.py @@ -134,6 +134,7 @@ def main(tarname, gitroot): 'release/test_install.py', 'release/sha256.py', 'release/authors.py', + 'release/ci_release_script.sh', # This is just a distribute version of setup.py. Used mainly for setup.py # develop, which we don't care about in the release tarball 'setupegg.py', From d467cb35705892b891122870cfd373cd93bd05c4 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 12:33:57 +0100 Subject: [PATCH 02/15] maint(release): run release script in CI --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000000..101b2e1454fc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +# ------------------------------------------------------------------ # +# # +# SymPy CI script for Github Actions # +# # +# Run on the release brancha dn builds the release artifacts. # +# # +# ------------------------------------------------------------------ # + +name: release +on: + push: + branches: + - 1.8 + pull_request: + branches: + - 1.8 +jobs: + + # -------------------- Build artifacts --------------------------- # + + build: + + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + - run: release/ci_release_script.sh + + - name: Archive build artifacts + uses: actions/upload-artifact@v2 + with: + name: build_artifacts + path: release-1.8 From bf30e90e2aa798d2401c40251a60ac939a8762ce Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 12:46:37 +0100 Subject: [PATCH 03/15] maint(release): run release script in CI --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 101b2e1454fc..d0849fb43e69 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/setup-python@v2 with: python-version: 3.8 - - run: release/ci_release_script.sh + - run: release/ci_release_script.sh 1.8 - name: Archive build artifacts uses: actions/upload-artifact@v2 From d94477f2a3ae79812dcf7eee3933afef3f8c6fcc Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 15:00:33 +0100 Subject: [PATCH 04/15] maint(release): run release script in CI --- .github/workflows/release.yml | 12 +++++++++--- bin/authors_update.py | 14 +++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0849fb43e69..be404aad5804 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ # # # SymPy CI script for Github Actions # # # -# Run on the release brancha dn builds the release artifacts. # +# Run on the release branch and builds the release artifacts. # # # # ------------------------------------------------------------------ # @@ -22,14 +22,20 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: 3.8 + + - run: sudo apt-get install -y git + - run: git clone https://github.com/sympy/sympy.git + - run: git checkout 1.8 + working-directory: sympy + - run: release/ci_release_script.sh 1.8 + working-directory: sympy - name: Archive build artifacts uses: actions/upload-artifact@v2 with: name: build_artifacts - path: release-1.8 + path: sympy/release-1.8 diff --git a/bin/authors_update.py b/bin/authors_update.py index e304ea0cc240..36048da33f65 100755 --- a/bin/authors_update.py +++ b/bin/authors_update.py @@ -18,10 +18,13 @@ if sys.version_info < (3, 6): sys.exit("This script requires Python 3.6 or newer") -from subprocess import run, PIPE +from subprocess import check_output, PIPE from distutils.version import LooseVersion from collections import OrderedDict +def run(cmd): + return check_output(cmd, encoding='utf-8') + def red(text): return "\033[31m%s\033[0m" % text @@ -43,7 +46,10 @@ def green(text): # check git version minimal = '1.8.4.2' -git_ver = run(['git', '--version'], stdout=PIPE, encoding='utf-8').stdout[12:] +git_ver = run(['git', '--version'])[12:] + +print('git version:', git_ver) + if LooseVersion(git_ver) < LooseVersion(minimal): print(yellow("Please use a git version >= %s" % minimal)) @@ -61,7 +67,9 @@ def move(l, i1, i2, who): # find who git knows ahout git_command = ["git", "log", "--topo-order", "--reverse", "--format=%aN <%aE>"] -git_people = run(git_command, stdout=PIPE, encoding='utf-8').stdout.strip().split("\n") +git_people = run(git_command).strip().split("\n") + +print('git_people', git_people) # remove duplicates, keeping the original order git_people = list(OrderedDict.fromkeys(git_people)) From f80486b0b1e9f0edbf0eb540b8ffe4919baabf84 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 15:04:56 +0100 Subject: [PATCH 05/15] maint(release): run release script in CI --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be404aad5804..23671b43b40c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: - run: git checkout 1.8 working-directory: sympy - - run: release/ci_release_script.sh 1.8 + - run: sympy/release/ci_release_script.sh 1.8 working-directory: sympy - name: Archive build artifacts From f39843f8ba6a50899392abbe844bafe41698c340 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 15:09:55 +0100 Subject: [PATCH 06/15] maint(release): run release script in CI --- .github/workflows/release.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 23671b43b40c..c743b44e6fdb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,8 +30,16 @@ jobs: - run: git clone https://github.com/sympy/sympy.git - run: git checkout 1.8 working-directory: sympy + - run: git pull + working-directory: sympy + + - run: pwd + working-directory: sympy + + - run: ls release + working-directory: sympy - - run: sympy/release/ci_release_script.sh 1.8 + - run: release/ci_release_script.sh 1.8 working-directory: sympy - name: Archive build artifacts From 334f9332f201a54f81a6a5f019293f7d74cc7299 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 15:16:35 +0100 Subject: [PATCH 07/15] maint(release): run release script in CI --- .github/workflows/release.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c743b44e6fdb..4f9b90417853 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,25 +22,16 @@ jobs: runs-on: ubuntu-20.04 steps: + # Check out with full git history for authors check: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-python@v2 with: python-version: 3.8 - - run: sudo apt-get install -y git - - run: git clone https://github.com/sympy/sympy.git - - run: git checkout 1.8 - working-directory: sympy - - run: git pull - working-directory: sympy - - - run: pwd - working-directory: sympy - - - run: ls release - working-directory: sympy - - run: release/ci_release_script.sh 1.8 - working-directory: sympy - name: Archive build artifacts uses: actions/upload-artifact@v2 From 135eaa96b66f8171acf8a7c7d2c88afadff35389 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 15:26:45 +0100 Subject: [PATCH 08/15] maint(release): run release script in CI --- bin/authors_update.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bin/authors_update.py b/bin/authors_update.py index 36048da33f65..999e6ce09a4b 100755 --- a/bin/authors_update.py +++ b/bin/authors_update.py @@ -48,8 +48,6 @@ def green(text): minimal = '1.8.4.2' git_ver = run(['git', '--version'])[12:] -print('git version:', git_ver) - if LooseVersion(git_ver) < LooseVersion(minimal): print(yellow("Please use a git version >= %s" % minimal)) @@ -69,8 +67,6 @@ def move(l, i1, i2, who): git_command = ["git", "log", "--topo-order", "--reverse", "--format=%aN <%aE>"] git_people = run(git_command).strip().split("\n") -print('git_people', git_people) - # remove duplicates, keeping the original order git_people = list(OrderedDict.fromkeys(git_people)) From 85237c1f6740cf4b680961b3e45f767c406f2429 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 15:33:21 +0100 Subject: [PATCH 09/15] maint(release): run release script in CI --- release/compare_tar_against_git.py | 1 + 1 file changed, 1 insertion(+) diff --git a/release/compare_tar_against_git.py b/release/compare_tar_against_git.py index 6fb64d610e10..d7b77ccd79f5 100755 --- a/release/compare_tar_against_git.py +++ b/release/compare_tar_against_git.py @@ -35,6 +35,7 @@ def main(tarname, gitroot): # Travis and CI '.travis.yml', '.github/workflows/runtests.yml', + '.github/workflows/release.yml', '.ci/durations.json', '.ci/generate_durations_log.sh', '.ci/parse_durations_log.py', From 51928f1f2169d8deb0a99264154296e014e843bc Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 16:01:03 +0100 Subject: [PATCH 10/15] maint(release): run release script in CI --- .github/workflows/release.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f9b90417853..5dfdb4afe7f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,13 +7,16 @@ # ------------------------------------------------------------------ # name: release +env: + release_branch: 1.8 + release_version: 1.8 on: push: branches: - - 1.8 + - {{ env.release_branch }} pull_request: branches: - - 1.8 + - {{ env.release_branch }} jobs: # -------------------- Build artifacts --------------------------- # @@ -31,10 +34,10 @@ jobs: with: python-version: 3.8 - - run: release/ci_release_script.sh 1.8 + - run: release/ci_release_script.sh {{ env.release_version }} - name: Archive build artifacts uses: actions/upload-artifact@v2 with: name: build_artifacts - path: sympy/release-1.8 + path: release-{{ env.release_version }} From 5d9a8f846bd75ed07cff1b81476b53ce8f48bb09 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 16:03:03 +0100 Subject: [PATCH 11/15] maint(release): run release script in CI --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5dfdb4afe7f2..2c297011c397 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,10 +13,10 @@ env: on: push: branches: - - {{ env.release_branch }} + - ${{ env.release_branch }} pull_request: branches: - - {{ env.release_branch }} + - ${{ env.release_branch }} jobs: # -------------------- Build artifacts --------------------------- # @@ -34,10 +34,10 @@ jobs: with: python-version: 3.8 - - run: release/ci_release_script.sh {{ env.release_version }} + - run: release/ci_release_script.sh ${{ env.release_version }} - name: Archive build artifacts uses: actions/upload-artifact@v2 with: name: build_artifacts - path: release-{{ env.release_version }} + path: release-${{ env.release_version }} From ae5739600d23a1986493e3a139bbbb3e0473a604 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 16:04:59 +0100 Subject: [PATCH 12/15] maint(release): run release script in CI --- .github/workflows/release.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c297011c397..c97b5c8ff9c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,16 +7,17 @@ # ------------------------------------------------------------------ # name: release -env: - release_branch: 1.8 - release_version: 1.8 on: push: branches: - - ${{ env.release_branch }} + - 1.8 pull_request: branches: - - ${{ env.release_branch }} + - 1.8 +env: + release_branch: 1.8 + release_version: 1.8 + jobs: # -------------------- Build artifacts --------------------------- # From 6675918e2f705db9d6b356b36c90aa308f9d15af Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 16:21:56 +0100 Subject: [PATCH 13/15] maint(release): run release script in CI --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c97b5c8ff9c2..db2ba865eee2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,14 +31,48 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-python@v2 + - name: Setup Python + uses: actions/setup-python@v2 with: python-version: 3.8 - - run: release/ci_release_script.sh ${{ env.release_version }} + - name: Build release files + run: release/ci_release_script.sh ${{ env.release_version }} - - name: Archive build artifacts + - name: Store release files uses: actions/upload-artifact@v2 with: - name: build_artifacts + name: release_files path: release-${{ env.release_version }} + + # -------------------- Test installation ------------------------- # + + test-install: + needs: [build] + + runs-on: ubuntu-20.04 + strategy: + matrix: + python-version: ['3.6', '3.7', '3.8', '3.9', 'pypy-3.6'] + + name: Python ${{ matrix.python-version }} test install + steps: + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + + - name: Retrieve release files + - uses: actions/download-artifact@v2 + with: + name: release_files + + - name: List files + run: ls -R + + - name: Install wheel + run: pip install sympy-${{ env.release_version }}-py3-none-any.whl + + - name: Run tests after install + run: python -c 'import sympy; sympy.test()' From 035ab6673fe08bfced5ae411021924ea14d10b7d Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 16:26:08 +0100 Subject: [PATCH 14/15] maint(release): run release script in CI --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db2ba865eee2..ebe9fab4e1f5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,7 @@ jobs: python-version: 3.8 - name: Build release files - run: release/ci_release_script.sh ${{ env.release_version }} + run: release/ci_release_script.sh ${{ env.release_version }} - name: Store release files uses: actions/upload-artifact@v2 From 28352d534821b045efb2015ab22f5645e1947a60 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 9 Apr 2021 16:27:40 +0100 Subject: [PATCH 15/15] maint(release): run release script in CI --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ebe9fab4e1f5..bf5b232865db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,7 @@ jobs: architecture: x64 - name: Retrieve release files - - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v2 with: name: release_files