Skip to content

Commit

Permalink
Merge pull request #264 from rstudio/mbh-docs-tests
Browse files Browse the repository at this point in the history
Enable fmt, lint, and docs
  • Loading branch information
meatballhat authored Jun 23, 2020
2 parents 58dec25 + 2f60386 commit c86b557
Show file tree
Hide file tree
Showing 39 changed files with 650 additions and 855 deletions.
10 changes: 2 additions & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
build/
dist/
notebooks*/
*/node_modules/
*.egg-info/
.eggs/
*.pyc
.git/
*
!Pipfile*
17 changes: 17 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[flake8]
max_line_length = 120
show_source = true
exclude = .git,.venv,.venv2,.venv3,__pycache__,.cache,.eggs

# The following codes are ignored so that `flake8` plays nicer with how `black`
# likes to format:
# - E203: whitespace before ':'
# - E231: missing whitespace after ',', ';', or ':'
# - E302: expected 2 blank lines, found 0
#
# ref:
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
#
extend_ignore = E203,E231,E302

# vim:filetype=dosini
48 changes: 37 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,18 @@ jobs:
- run: pipenv install --dev
- run: pipenv run pip freeze
- run: pipenv run python setup.py --version
- run: pipenv run python -Wi setup.py test
- run: make install
- run: make lint
- run: make test
- if: false
name: currently busted selenium test stuff
run: >
make image${{ matrix.python-version }}
make -C selenium build
make -C selenium clean
make -C selenium test-env-up
make -C selenium jupyter-up
make -C selenium test
distributions:
needs: test
runs-on: ubuntu-latest
Expand Down Expand Up @@ -115,13 +126,28 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
# docs:
# needs: test
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - run: make docs-build
# - uses: actions/upload-artifact@v2
# with:
# name: docs
# path: docs/site/
docs:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: make docs-build
- uses: actions/upload-artifact@v2
with:
name: docs
path: docs/out/
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET }}
aws-region: us-east-1
- if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: make sync-latest-docs-to-s3
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.DOCS_AWS_ID }}
aws-secret-access-key: ${{ secrets.DOCS_AWS_SECRET }}
aws-region: us-east-1
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: make promote-docs-in-s3
18 changes: 10 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
*.pyc
/build/
/dist/
.DS_Store
.coverage
.vagrant
/*.egg
/*.egg-info
/*.eggs
/.conda/
/.idea/
/.jupyter/
/.local/
/.idea/
/build/
/dist/
/docs/out/
/node_modules/
/notebooks*/
/*.egg-info
/*.egg
/*.eggs
.DS_Store
.vagrant
/rsconnect_jupyter/static/version.json
/rsconnect_jupyter/version.py
26 changes: 19 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,30 @@ LABEL maintainer="RStudio Connect <[email protected]>"
ARG NB_UID
ARG NB_GID
ARG PY_VERSION
RUN apt-get update -qq \
&& apt-get install -y make
RUN apt-get update -qq && \
apt-get install -y make curl xz-utils git && \
curl -fsSL "https://nodejs.org/dist/v12.18.1/node-v12.18.1-linux-x64.tar.xz" | \
tar --strip-components=1 -C /usr/local -xJf - && \
npm install -g yarn

RUN getent group ${NB_GID} || groupadd -g ${NB_GID} builder
RUN useradd --password password \
--create-home \
--home-dir /home/builder \
--uid ${NB_UID} \
--gid ${NB_GID} \
builder

RUN conda update conda
builder && \
mkdir -p /rsconnect_jupyter && \
chown ${NB_UID}:${NB_GID} /rsconnect_jupyter

USER ${NB_UID}:${NB_GID}
RUN bash -c 'cd /home/builder \
&& conda create --yes --channel conda-forge --name py${PY_VERSION/./} python=${PY_VERSION} jupyter numpy matplotlib setuptools pip pipenv'
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
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*
Loading

0 comments on commit c86b557

Please sign in to comment.