From 926ce2770b39064ba8d05b9c87bb84d3723e9e97 Mon Sep 17 00:00:00 2001 From: Iwan Aucamp Date: Sun, 17 Jul 2022 23:18:26 +0200 Subject: [PATCH] build: Gitpod integration and Google Cloud Shell Button Add Gitpod integration mainly intended to make it easier for contributors to work with RDFLib and also to get CI validation of `Dockerfile.devcontainer`. Other changes: - Add a button for Google cloud shell integration, it is maybe not as nice as Gitpod but it provides a lot more free hours than Gitpod and it does work with the devcontainer based workflow even if the editor does not integrate with devcontainers directly. - Removed additional python versions from the devcontainer dockerfile. This is mainly to make the devcontainer less unwieldy and quicker to build. - Slim down the devcontainer Dockerfile by removing some uneeded packages, this will make it faster to build. --- .gitpod.yml | 29 +++++++++++++++++++++++++++++ Dockerfile.devcontainer | 29 +++++++---------------------- README.md | 6 ++++++ docs/developers.rst | 4 ++-- 4 files changed, 44 insertions(+), 24 deletions(-) create mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 000000000..f6b80c63f --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,29 @@ +# https://www.gitpod.io/docs/references/gitpod-yml +image: + file: Dockerfile.devcontainer + context: . +tasks: + - before: | + task install:pip-deps + command: | + task --list +github: + prebuilds: + addBadge: false + addCheck: prevent-merge-on-error + addComment: false + branches: false + master: false + pullRequests: false + pullRequestsFromForks: false +vscode: + extensions: + - ms-python.python + - redhat.vscode-yaml + - redhat.vscode-xml + - stardog-union.stardog-rdf-grammars + - lextudio.restructuredtext + - trond-snekvik.simple-rst + - EditorConfig.EditorConfig + - paulvarache.vscode-taskfile + - stardog-union.vscode-stardog-languages diff --git a/Dockerfile.devcontainer b/Dockerfile.devcontainer index ed071e441..0449df116 100644 --- a/Dockerfile.devcontainer +++ b/Dockerfile.devcontainer @@ -4,7 +4,7 @@ ENV DEBIAN_FRONTEND="noninteractive" TZ="Etc/UTC" RUN \ apt-get update && \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ make \ curl \ git \ @@ -13,43 +13,27 @@ RUN \ true RUN \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ libdb-dev \ libjpeg-dev \ && \ true RUN \ - apt-get install -y \ - default-jdk \ + apt-get install -y --no-install-recommends \ + default-jre-headless \ && \ true RUN \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ software-properties-common \ && \ - add-apt-repository ppa:deadsnakes/ppa && \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ python3 \ python3-pip \ python3-dev \ python3-venv \ - python3.7 \ - python3.7-dev \ - python3.7-venv \ - python3.8 \ - python3.8-dev \ - python3.8-venv \ - python3.9 \ - python3.9-dev \ - python3.9-venv \ - python3.10 \ - python3.10-dev \ - python3.10-venv \ - python3.11 \ - python3.11-dev \ - python3.11-venv \ python-is-python3 \ && \ python --version && \ @@ -62,6 +46,7 @@ COPY docs/sphinx-requirements.txt /var/tmp/docs/sphinx-requirements.txt RUN \ cd /var/tmp/ && \ + grep -H . requirements*.txt docs/sphinx-requirements.txt && \ python -m pip install --upgrade \ -r requirements.txt \ -r requirements.dev.txt \ diff --git a/README.md b/README.md index fcb31c4bc..3e491cf8b 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ RDFLib [![GitHub stars](https://img.shields.io/github/stars/RDFLib/rdflib.svg)](https://github.com/RDFLib/rdflib/stargazers) [![PyPI](https://img.shields.io/pypi/v/rdflib.svg)](https://pypi.python.org/pypi/rdflib) [![PyPI](https://img.shields.io/pypi/pyversions/rdflib.svg)](https://pypi.python.org/pypi/rdflib) +[![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/RDFLib/rdflib) RDFLib is a pure Python package for working with [RDF](http://www.w3.org/RDF/). RDFLib contains most things you need to work with RDF, including: @@ -200,6 +201,11 @@ Please consider lodging Pull Requests here: * +To get a development environment consider using Gitpod or Google Cloud Shell. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/RDFLib/rdflib) +[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://shell.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2FRDFLib%2Frdflib&cloudshell_git_branch=master&cloudshell_open_in_editor=README.md) + You can also raise issues here: * diff --git a/docs/developers.rst b/docs/developers.rst index c6ac67637..0ed3c3b88 100644 --- a/docs/developers.rst +++ b/docs/developers.rst @@ -306,8 +306,8 @@ To use the development container directly: # Run the validate task inside the devtools container. docker-compose run --rm devcontainer task validate - # Run tox for python 3.11 inside the devtools container, - docker-compose run --rm devcontainer task tox -- -e py311 + # Run extensive tests inside the devtools container. + docker-compose run --rm devcontainer task EXTENSIVE=true test # To get a shell into the devcontainer docker image. docker-compose run --rm devcontainer bash