Skip to content

Commit

Permalink
drop pipenv and caching
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarchetti committed Feb 1, 2021
1 parent da01873 commit 2e8e81c
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 1,109 deletions.
92 changes: 13 additions & 79 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,13 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- if: matrix.os != 'macos-latest'
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: pip-${{ matrix.os }}-py${{ matrix.python-version }}-${{ hashFiles('Pipfile.lock') }}
restore-keys: |
pip-${{ matrix.os }}-py${{ matrix.python-version }}-${{ hashFiles('Pipfile.lock') }}
pip-${{ matrix.os }}-py${{ matrix.python-version }}-
- if: matrix.os == 'macos-latest'
uses: actions/cache@v1
with:
path: ~/Library/Caches/pip
key: pip-${{ matrix.os }}-py${{ matrix.python-version }}-${{ hashFiles('Pipfile.lock') }}
restore-keys: |
pip-${{ matrix.os }}-py${{ matrix.python-version }}-${{ hashFiles('Pipfile.lock') }}
pip-${{ matrix.os }}-py${{ matrix.python-version }}-
- uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: virtualenvs-${{ matrix.os }}-py${{ matrix.python-version }}-${{ hashFiles('Pipfile.lock') }}
restore-keys: |
virtualenvs-${{ matrix.os }}-py${{ matrix.python-version }}-${{ hashFiles('Pipfile.lock') }}
virtualenvs-${{ matrix.os }}-py${{ matrix.python-version }}-
- run: pip install -U pipenv pip
- run: make deps
- run: pipenv run pip freeze
- run: pip install -r requirements.txt
- run: pip freeze
- if: matrix.python-version != '2.7' && matrix.python-version != '3.5'
run: make fmt
- if: matrix.python-version != '2.7' && matrix.python-version != '3.5'
run: make lint
- run: pipenv run python setup.py --version
- run: run python setup.py --version
- run: make test
prerelease-test:
runs-on: ubuntu-latest
Expand All @@ -64,25 +40,11 @@ jobs:
- 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: pip install --pre -r requirements.txt
- run: pip freeze
- run: make fmt
- run: make lint
- run: pipenv run python setup.py --version
- run: python setup.py --version
- run: make test
distributions:
needs: test
Expand All @@ -93,31 +55,17 @@ jobs:
- 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 pipenv pip
- run: make deps
- run: pip install -r requirements.txt
- run: pip freeze
- run: make dist
id: create_dist
- uses: actions/upload-artifact@v2
with:
name: distributions
path: dist/
- run: pipenv run pip install -vvv ${{ steps.create_dist.outputs.whl }}
- run: pipenv run rsconnect version
- run: pipenv run rsconnect --help
- run: pip install -vvv ${{ steps.create_dist.outputs.whl }}
- run: rsconnect version
- run: rsconnect --help
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
id: create_release
uses: actions/create-release@v1
Expand Down Expand Up @@ -160,22 +108,8 @@ jobs:
- 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 pipenv pip
- run: make deps
- run: pip install -r requirements.txt
- run: pip freeze
- run: make docs
- uses: actions/upload-artifact@v2
with:
Expand Down
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ ARG BASE_IMAGE
FROM ${BASE_IMAGE}

WORKDIR /rsconnect
ENV WORKON_HOME=/.cache \
PIPENV_CACHE_DIR=/.cache \
PIPENV_DONT_LOAD_ENV=1 \
PIPENV_SHELL=/bin/bash
COPY Pipfile Pipfile
COPY Pipfile.lock Pipfile.lock
COPY scripts/build-image build-image
RUN bash build-image && rm -vf build-image Pipfile*
COPY requirements.txt requirements.txt
RUN bash build-image && rm -vf build-image
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION := $(shell pipenv run python setup.py --version)
VERSION := $(shell python setup.py --version)
HOSTNAME := $(shell hostname)
S3_PREFIX := s3://rstudio-connect-downloads/connect/rsconnect-python

Expand All @@ -12,7 +12,7 @@ RUNNER = docker run \
bash -c

TEST_COMMAND ?= ./scripts/runtests
SHELL_COMMAND ?= pipenv shell
SHELL_COMMAND ?= bash

ifneq ($(GITHUB_RUN_ID),)
RUNNER = bash -c
Expand Down Expand Up @@ -53,7 +53,7 @@ mock-test-%: clean-stores
@$(MAKE) -C mock_connect down

fmt-%:
$(RUNNER) 'pipenv run black .'
$(RUNNER) 'black .'

.PHONY: fmt-2.7
fmt-2.7: .fmt-unsupported
Expand All @@ -68,15 +68,15 @@ fmt-3.5: .fmt-unsupported

.PHONY: deps-prerelease
deps-prerelease:
pipenv run ./scripts/install-deps-prerelease
pip install --pre -r requirements.txt

deps-%:
$(RUNNER) 'pipenv run ./scripts/install-deps'
$(RUNNER) 'pip install --pre -r requirements.txt'

lint-%:
$(RUNNER) 'pipenv run black --check --diff .'
$(RUNNER) 'pipenv run flake8 rsconnect/'
$(RUNNER) 'pipenv run mypy -p rsconnect'
$(RUNNER) 'black --check --diff rsconnect/'
$(RUNNER) 'flake8 rsconnect/'
$(RUNNER) 'mypy -p rsconnect'

.PHONY: lint-2.7
lint-2.7: .lint-unsupported
Expand Down Expand Up @@ -137,8 +137,8 @@ version:
# exported as a point of reference instead.
.PHONY: dist
dist:
pipenv run python setup.py bdist_wheel
pipenv run twine check $(BDIST_WHEEL)
python setup.py bdist_wheel
twine check $(BDIST_WHEEL)
rm -vf dist/*.egg
@echo "::set-output name=whl::$(BDIST_WHEEL)"
@echo "::set-output name=whl_basename::$(notdir $(BDIST_WHEEL))"
Expand Down
30 changes: 0 additions & 30 deletions Pipfile

This file was deleted.

Loading

0 comments on commit 2e8e81c

Please sign in to comment.