Skip to content

Commit

Permalink
remove pipenv
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarchetti committed Feb 13, 2023
1 parent 80ee016 commit 97694a1
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 1,743 deletions.
2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

24 changes: 16 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,21 @@ jobs:
- run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
- run: make prereqs
- run: make version
- run: make install
- run: make lint
- run: make test
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: actions/setup-python@v2
with:
python-version: 3.8
- run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
- run: make prereqs
- run: make version
- run: make yarn
- run: make lint
selenium:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -66,18 +78,14 @@ jobs:
python-version: 3.8.x
- run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
- run: make prereqs
- run: pipenv clean
- run: pipenv install --skip-lock --dev
- run: pipenv run pip install -U 'SecretStorage>=3'
- run: git reset --hard HEAD
- 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 python -c 'import rsconnect_jupyter;print(rsconnect_jupyter.__version__)'
- run: pip install -vvv ${{ steps.create_dist.outputs.whl }}
- run: python -c 'import rsconnect_jupyter;print(rsconnect_jupyter.__version__)'
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
id: create_release
uses: actions/create-release@v1
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,11 @@ jobs:
with:
fetch-depth: 0

- name: Install pipenv
run: |
python -m pip install --upgrade pipenv
- name: Install Pipfile dependencies (as required by Snyk)
run: pipenv install

- name: Run Snyk
uses: snyk/actions/python@master
with:
command: monitor
args: --file=Pipfile --project-name=python --org=${{ env.SNYK_ORG }}
args: --file=requirements-dev.txt --project-name=python --org=${{ env.SNYK_ORG }}
ui:
runs-on: ubuntu-latest
steps:
Expand Down
13 changes: 5 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@ RUN useradd --password password \
chown ${NB_UID}:${NB_GID} /rsconnect_jupyter

USER ${NB_UID}:${NB_GID}
WORKDIR /rsconnect_jupyter
ENV WORKON_HOME=/home/builder \
PIPENV_DONT_LOAD_ENV=1 \
PIPENV_SHELL=/bin/bash \
PATH=/home/builder/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
PYTHONPATH=/rsconnect_jupyter
COPY Pipfile Pipfile
COPY Pipfile.lock Pipfile.lock
RUN python -m pip install -I -U pip pipenv && \
pipenv install --dev --python=/usr/local/bin/python && \
rm -vf Pipfile*
COPY requirements.txt .
COPY requirements-dev.txt .
RUN /usr/local/bin/python -m pip install -I -U pip && \
/usr/local/bin/python -m pip install -r requirements-dev.txt
WORKDIR /rsconnect_jupyter
43 changes: 15 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ IMAGE := rstudio/rsconnect-jupyter-py
NOTEBOOKS_DIR := /notebooks
PORT := $(shell printenv PORT || echo 9999)
S3_PREFIX := s3://rstudio-connect-downloads/connect/rsconnect-jupyter
VERSION := $(shell pipenv run python setup.py --version 2>/dev/null || echo 'NOTSET')
VERSION := $(shell python setup.py --version 2>/dev/null || echo 'NOTSET')

BDIST_WHEEL := dist/rsconnect_jupyter-$(VERSION)-py2.py3-none-any.whl
JUPYTER_LOG_LEVEL ?= INFO
Expand All @@ -17,16 +17,14 @@ export SOURCE_DATE_EPOCH
PYTHONPATH ?= $(CURDIR)
export PYTHONPATH


.PHONY: prereqs
prereqs:
pip install -U pip
pip install -U pipenv

pip install -r requirements-dev.txt

.PHONY: install-latest-rsconnect-python
install-latest-rsconnect-python:
pipenv run pip install -U https://cdn.rstudio.com/connect/rsconnect-python/latest/rsconnect_python-latest-py2.py3-none-any.whl
pip install -U https://cdn.rstudio.com/connect/rsconnect-python/latest/rsconnect_python-latest-py2.py3-none-any.whl

.PHONY: clean
clean:
Expand All @@ -45,12 +43,8 @@ image%:
--build-arg PY_VERSION=$* \
.

.PHONY: all-tests
all-tests: test3.7 test3.8 test3.9 test3.10 test3.11

.PHONY: test
test: version-frontend
pipenv run pytest -vv --cov=rsconnect_jupyter tests/
pytest -vv --cov=rsconnect_jupyter tests/

.PHONY: test-selenium
test-selenium:
Expand All @@ -64,16 +58,15 @@ test-selenium:
# exported as a point of reference instead.
.PHONY: dist
dist: version-frontend
pipenv run python setup.py bdist_wheel
pipenv run twine check $(BDIST_WHEEL)
rm -vf dist/*.whl
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))"

.PHONY: run
run: install
mkdir -p $(NOTEBOOKS_DIR)
pipenv run jupyter notebook \
jupyter notebook \
-y \
--log-level=$(JUPYTER_LOG_LEVEL) \
--notebook-dir=$(NOTEBOOKS_DIR) \
Expand All @@ -82,17 +75,11 @@ run: install
--no-browser \
--NotebookApp.token=''

.PHONY: run-local
run-local: NOTEBOOKS_DIR := $(CURDIR)/notebooks3.8
run-local: run

.PHONY: install
install: yarn
pipenv install --dev
$(MAKE) version-frontend
pipenv run jupyter nbextension install --symlink --user --py rsconnect_jupyter
pipenv run jupyter nbextension enable --py rsconnect_jupyter
pipenv run jupyter serverextension enable --py rsconnect_jupyter
install: version-frontend
jupyter nbextension install --symlink --user --py rsconnect_jupyter
jupyter nbextension enable --py rsconnect_jupyter
jupyter serverextension enable --py rsconnect_jupyter

build/mock-connect/bin/flask:
bash -c '\
Expand Down Expand Up @@ -120,12 +107,12 @@ lint-js:

.PHONY: lint-py
lint-py:
pipenv run black --check --diff ./rsconnect_jupyter
pipenv run flake8 ./rsconnect_jupyter
black --check --diff ./rsconnect_jupyter
flake8 ./rsconnect_jupyter

.PHONY: fmt
fmt:
pipenv run black ./rsconnect_jupyter
black ./rsconnect_jupyter

## Specify that Docker runs with the calling user's uid/gid to avoid file
## permission issues on Linux dev hosts.
Expand Down
35 changes: 0 additions & 35 deletions Pipfile

This file was deleted.

Loading

0 comments on commit 97694a1

Please sign in to comment.