diff --git a/CONTRIBUTING b/CONTRIBUTING deleted file mode 100644 index 0e0061be..00000000 --- a/CONTRIBUTING +++ /dev/null @@ -1,66 +0,0 @@ -# User Guide - -Installation and usage instructions are available -[here](https://github.com/rstudio/rsconnect-jupyter/tree/master/docs). - -# Developing `rsconnect-jupyter` - -Need to run this after checkout and when modifying the docker images - - make images - -Launch jupyter in a python 2 environment - - make notebook2 - -Launch jupyter in a python 3 environment - - make notebook3 - -## Trying out notebooks - -> Note: notebooks in the `notebooks2` and `notebooks3` directories will be -> available in respective python environments. - -Sample notebooks can be obtained from: - -- https://github.com/ipython/ipython-in-depth -- https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting-Jupyter-Notebooks -- https://losc.ligo.org/tutorials/ -- http://nb.bianp.net/sort/views/ - -e.g. - -``` -cd notebooks3 -git clone https://github.com/ipython/ipython-in-depth -``` - -## Seeing code changes - -When modifying JavaScript files simply refresh the browser window to see -changes. - -When modifying Python files restart the jupyter process to see changes. - -# Packaging - -The following will create a universal [wheel](https://pythonwheels.com/) ready -to be installed in any python 2 or python 3 environment. - - make package - -## Updating rsconnect-jupyter on conda-forge - -rsconnect-jupyter exists on conda-forge as its own [feedstock](https://github.com/conda-forge/rsconnect-jupyter-feedstock) - -Updating the package requires a fork of the repository and a push request [example workflow](https://conda-forge.org/docs/maintainer/updating_pkgs.html#example-workflow-for-updating-a-package). - -- For new version/release, update the [meta.yaml](https://github.com/conda-forge/rsconnect-jupyter-feedstock/blob/master/recipe/meta.yaml) file with the new version number, source url, and corresponding checksum. - -- For a rebuild of the same version, increase "number" under "build" by one in the [meta.yaml](https://github.com/conda-forge/rsconnect-jupyter-feedstock/blob/master/recipe/meta.yaml) file. - - -### Adding yourself as a rsconnect-jupyter conda-forge maintainer - -Add your github username under recipe-maintainers in the [meta.yaml](https://github.com/conda-forge/rsconnect-jupyter-feedstock/blob/master/recipe/meta.yaml) file. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..694f5aec --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,99 @@ +# Contributing Guidelines + +This documentation covers common tasks related to development. + +For installation and usage instructions see [README.md](./README.md). + + +**Table of Contents** + +- [Contributing Guidelines](#contributing-guidelines) +- [Development](#development) + - [Trying out notebooks](#trying-out-notebooks) + - [Seeing code changes](#seeing-code-changes) +- [Packaging](#packaging) +- [Versioning and Releases](#versioning-and-releases) + - [Versioning](#versioning) + - [Releases](#releases) + - [Releasing on Conda Forge](#releasing-on-conda-forge) + - [Adding yourself as a rsconnect-jupyter conda-forge maintainer](#adding-yourself-as-a-rsconnect-jupyter-conda-forge-maintainer) + + + +# Development + +Need to run this after checkout and when modifying the docker images + + make images + +Launch jupyter in a python 3 environment + + make notebook3 + +## Trying out notebooks + +> Note: notebooks in the `notebooks3` directories will be available in respective python environments. + +Sample notebooks can be obtained from: + +- https://github.com/ipython/ipython-in-depth +- https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting-Jupyter-Notebooks +- https://losc.ligo.org/tutorials/ +- http://nb.bianp.net/sort/views/ + +e.g. + +``` +cd notebooks3 +git clone https://github.com/ipython/ipython-in-depth +``` + +## Seeing code changes + +When modifying JavaScript files simply refresh the browser window to see +changes. + +When modifying Python files restart the jupyter process to see changes. + +# Packaging + +The following will create a universal [wheel](https://pythonwheels.com/) ready +to be installed in any python 2 or python 3 environment. + + make package +# Versioning and Releases + +## Versioning + +Versioning is accomplished via Git tagging using [Semantic Versioning](https://semver.org/). Read more about tagging [here](https://git-scm.com/book/en/v2/Git-Basics-Tagging). +o view the most recent release tag, execute the following. + +```shell +git describe master --match "v*" --tags +``` + +## Releases + +Releases are accomplished through GitHub Actions. + +To initiate a release, create a manual tag use the following steps. The `..` values **MUST** follow semantic versioning. + + git tag v.. + git push origin v.. + +Once pushed, a GitHub Action will be trigged. This action with publish the release to [PyPi](https://pypi.org/project/rsconnect-jupyter/) using the specified version. + +### Releasing on Conda Forge + +`rsconnect-jupyter` exists on conda-forge as its own [feedstock](https://github.com/conda-forge/rsconnect-jupyter-feedstock) + +Updating the package requires a fork of the repository and a push request [example workflow](https://conda-forge.org/docs/maintainer/updating_pkgs.html#example-workflow-for-updating-a-package). + +- For new version/release, update the [meta.yaml](https://github.com/conda-forge/rsconnect-jupyter-feedstock/blob/master/recipe/meta.yaml) file with the new version number, source url, and corresponding checksum. + +- For a rebuild of the same version, increase "number" under "build" by one in the [meta.yaml](https://github.com/conda-forge/rsconnect-jupyter-feedstock/blob/master/recipe/meta.yaml) file. + +### Adding yourself as a rsconnect-jupyter conda-forge maintainer + +Add your GitHub username under recipe-maintainers in the [meta.yaml](https://github.com/conda-forge/rsconnect-jupyter-feedstock/blob/master/recipe/meta.yaml) file. + diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 74c4edd8..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,201 +0,0 @@ -#!groovy - -def gitClean() { - // inspired by: https://issues.jenkins-ci.org/browse/JENKINS-31924 - // https://issues.jenkins-ci.org/browse/JENKINS-32540 - // The sequence of reset --hard and clean -fdx first - // in the root and then using submodule foreach - // is based on how the Jenkins Git SCM clean before checkout - // feature works. - sh 'git reset --hard' - sh 'git clean -ffdx' -} - -// Build the name:tag for a docker image where the tag is the checksum -// computed from a specified file. -def imageName(name, filenames) { - // If this is extended to support multiple files, be wary of: - // https://issues.jenkins-ci.org/browse/JENKINS-26481 - // closures don't really work. - - // Suck in the contents of the file and then hash the result. - def contents = ""; - for (int i=0; i" - - // Looking up the author also demands being in a `node`. - gitAuthor = sh(returnStdout: true, script: 'git --no-pager show -s --format="%aN" HEAD').trim() - - stage('Docker build and test') { - parallel( - 'python2.7': { - buildAndTest("2.7") - }, - 'python3.5': { - img = buildAndTest("3.5") - }, - 'python3.6': { - img = buildAndTest("3.6") - - img.inside("-v ${env.WORKSPACE}:/rsconnect_jupyter") { - sh "pip install --user --upgrade twine setuptools wheel" - print "building python wheel package" - sh 'make dist' - archiveArtifacts artifacts: 'dist/*.whl,dist/*.tar.gz' - stash includes: 'dist/*.whl,dist/*.tar.gz', name: 'wheel' - } - }, - 'python3.7': { - img = buildAndTest("3.7") - }, - 'code-quality': { - def uid = sh (script: 'id -u jenkins', returnStdout: true).trim() - def gid = sh (script: 'id -g jenkins', returnStdout: true).trim() - img = pullBuildPush( - image_name: 'jenkins/rsconnect-jupyter-yarn', - image_tag: 'latest', - docker_context: './tools/yarn', - build_arg_nb_uid: 'JENKINS_UID', - build_arg_nb_gid: 'JENKINS_GID', - build_args: "--build-arg NB_UID=${uid} --build-arg NB_GID=${gid}", - push: !isUserBranch - ) - img.inside("-v ${env.WORKSPACE}:/rsconnect_jupyter") { - sh 'make yarn' - sh 'make lint' - } - } - ) - } - stage('Docs build') { - docs_image = pullBuildPush( - image_name: 'jenkins/rsconnect-jupyter', - image_tag: 'docs', - docker_context: './docs', - push: !isUserBranch - ) - docs_image.inside("-v ${env.WORKSPACE}:/rsconnect_jupyter") { - sh 'make docs-build' - archiveArtifacts artifacts: 'dist/*.pdf,dist/*.html' - stash includes: 'dist/*.pdf,dist/*.html', name: 'docs' - } - } - stage('S3 upload') { - unstash 'wheel' - unstash 'docs' - publishArtifacts() - } - } - } - - // Slack message includes username information. - message = "${messagePrefix} by ${gitAuthor} passed" - slackSend channel: slackChannelPass, color: 'good', message: message -} catch(err) { - // Slack message includes username information. When master/release fails, - // CC the whole connect team. - slackNameFail = "unknown" - if (!isUserBranch) { - slackNameFail = "${gitAuthor} (cc @rsconnect_jupyter)" - } - - message = "${messagePrefix} by ${slackNameFail} failed: ${err}" - slackSend channel: slackChannelFail, color: 'bad', message: message - throw err -} diff --git a/notebooks2/.keep b/notebooks2/.keep deleted file mode 100644 index e69de29b..00000000