From c87f4cd83343c81e9826df076dcc297ade368cb5 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Thu, 25 Jun 2020 00:06:50 -0400 Subject: [PATCH 1/5] Try installing pre-releases of only direct requirements --- .github/workflows/main.yml | 5 +---- .gitignore | 1 + Makefile | 4 ++++ scripts/install-deps | 33 +++++++++++++++++++-------------- scripts/install-deps-prerelease | 27 +++++++++++++++++++++++++++ setup.cfg | 3 +++ 6 files changed, 55 insertions(+), 18 deletions(-) create mode 100755 scripts/install-deps-prerelease diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2fff70b0..2dff695c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,10 +64,7 @@ jobs: with: python-version: 3.8.x - run: pip install -U -I --pre pipenv pip - - run: pipenv lock --dev --pre --requirements | awk -F= '{ print $1 }' >requirements-unlocked.txt - - run: pipenv run pip install --pre -r requirements-unlocked.txt - - run: pipenv run pip freeze - - run: rm -vf requirements-unlocked.txt + - run: make deps-prerelease - run: make fmt - run: make lint - run: pipenv run python setup.py --version diff --git a/.gitignore b/.gitignore index 281343ab..9f067926 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ /.idea/ /.jupyter/ /.local/ +/.pipenv-requires /build/ /dist/ /node_modules/ diff --git a/Makefile b/Makefile index 6870c392..9a06ee98 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,10 @@ fmt-3.5: .fmt-unsupported @echo ERROR: This python version cannot run the fmting tools @exit 1 +.PHONY: deps-prerelease +deps-prerelease: + pipenv run ./scripts/install-deps-prerelease + deps-%: $(RUNNER) 'pipenv run ./scripts/install-deps' diff --git a/scripts/install-deps b/scripts/install-deps index 02e25fa8..ea6cc145 100755 --- a/scripts/install-deps +++ b/scripts/install-deps @@ -1,18 +1,23 @@ #!/usr/bin/env bash set -o errexit set -o pipefail -set -o xtrace -case "${PYTHON_VERSION}" in -2* | 3.5*) - pipenv install --skip-lock - pipenv run pip install \ - pytest \ - pytest-cov \ - 'coverage[toml]' \ - setuptools_scm - ;; -*) - pipenv install --dev - ;; -esac +main() { + set -o xtrace + + case "${PYTHON_VERSION}" in + 2* | 3.5*) + pipenv install --skip-lock + pipenv run pip install \ + pytest \ + pytest-cov \ + 'coverage[toml]' \ + setuptools_scm + ;; + *) + pipenv install --dev + ;; + esac +} + +main "${@}" diff --git a/scripts/install-deps-prerelease b/scripts/install-deps-prerelease new file mode 100755 index 00000000..fd62ab44 --- /dev/null +++ b/scripts/install-deps-prerelease @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -o errexit +set -o pipefail + +main() { + set -o xtrace + + local top + top="$(git rev-parse --show-toplevel)" + + local pipenv_requires="${top}/.pipenv-requires" + + _print_pipfile_packages >"${pipenv_requires}" + pipenv run pip install -U --pre -r "${pipenv_requires}" + rm -f "${pipenv_requires}" +} + +_print_pipfile_packages() { + pipenv run python <=7.0.0 setup_requires = setuptools + setuptools_scm>=3.4 + toml + wheel packages = rsconnect python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* zip_safe = true From e9c79d9066fda91e279d916b9fdb7bd7513de457 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Thu, 25 Jun 2020 00:10:07 -0400 Subject: [PATCH 2/5] Install toml for use in prerelease script --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2dff695c..7b9d06f5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,7 +63,7 @@ jobs: - uses: actions/setup-python@v2 with: python-version: 3.8.x - - run: pip install -U -I --pre pipenv pip + - run: pip install -U -I --pre pipenv pip toml - run: make deps-prerelease - run: make fmt - run: make lint From 34ee9dc5e258995c9b6ad6191fe8162fb94b670f Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Thu, 25 Jun 2020 00:12:43 -0400 Subject: [PATCH 3/5] Install toml where needed --- .github/workflows/main.yml | 2 +- scripts/install-deps-prerelease | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b9d06f5..2dff695c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,7 +63,7 @@ jobs: - uses: actions/setup-python@v2 with: python-version: 3.8.x - - run: pip install -U -I --pre pipenv pip toml + - run: pip install -U -I --pre pipenv pip - run: make deps-prerelease - run: make fmt - run: make lint diff --git a/scripts/install-deps-prerelease b/scripts/install-deps-prerelease index fd62ab44..656d334e 100755 --- a/scripts/install-deps-prerelease +++ b/scripts/install-deps-prerelease @@ -10,6 +10,7 @@ main() { local pipenv_requires="${top}/.pipenv-requires" + pipenv run pip install toml _print_pipfile_packages >"${pipenv_requires}" pipenv run pip install -U --pre -r "${pipenv_requires}" rm -f "${pipenv_requires}" From 367d73f073e0b9af81f78370c4afa32798ee1d40 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Thu, 25 Jun 2020 00:16:27 -0400 Subject: [PATCH 4/5] Install everything first, then upgrade to prerelease? --- scripts/install-deps-prerelease | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-deps-prerelease b/scripts/install-deps-prerelease index 656d334e..b33f5041 100755 --- a/scripts/install-deps-prerelease +++ b/scripts/install-deps-prerelease @@ -10,7 +10,7 @@ main() { local pipenv_requires="${top}/.pipenv-requires" - pipenv run pip install toml + pipenv install --dev _print_pipfile_packages >"${pipenv_requires}" pipenv run pip install -U --pre -r "${pipenv_requires}" rm -f "${pipenv_requires}" From 31e9ece31b5b7710ff0719b1856de7712c250560 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Thu, 25 Jun 2020 00:20:48 -0400 Subject: [PATCH 5/5] Use same caching as dist for prerelease --- .github/workflows/main.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2dff695c..fa02f514 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,9 +60,24 @@ jobs: continue-on-error: true steps: - uses: actions/checkout@v2 + - run: git fetch --prune --unshallow - uses: actions/setup-python@v2 with: python-version: 3.8.x + - uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: pip-ubuntu-latest-py3.8-${{ hashFiles('Pipfile.lock') }} + restore-keys: | + pip-ubuntu-latest-py3.8-${{ hashFiles('Pipfile.lock') }} + pip-ubuntu-latest-py3.8- + - uses: actions/cache@v1 + with: + path: ~/.local/share/virtualenvs + key: virtualenvs-ubuntu-latest-py3.8-${{ hashFiles('Pipfile.lock') }} + restore-keys: | + virtualenvs-ubuntu-latest-py3.8-${{ hashFiles('Pipfile.lock') }} + virtualenvs-ubuntu-latest-py3.8- - run: pip install -U -I --pre pipenv pip - run: make deps-prerelease - run: make fmt