From 793c0e6ba6bc71ef6aec5f485fa7f6ddbd927f62 Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Wed, 6 Mar 2019 08:10:16 -0500 Subject: [PATCH 1/2] Convert conda packaging to noarch format and update release instructions --- .circleci/config.yml | 56 ------------- .circleci/create_conda_packages.sh | 19 ----- contributing.md | 128 ++++++++++++++--------------- recipe/meta.yaml | 3 +- 4 files changed, 63 insertions(+), 143 deletions(-) delete mode 100755 .circleci/create_conda_packages.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index e302308031e..2b8d35d7c3a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -446,7 +446,6 @@ workflows: build: jobs: - - python-2.7-core - python-3.4-core - python-3.5-core @@ -465,58 +464,3 @@ workflows: - python-3-5-orca - python-3-7-orca - - python-2-7-conda: - requires: - - python-2.7-core - - python-2.7-optional - - python-2.7-plot_ly - - python-2-7-orca - - filters: - branches: - only: - - master - - /release_.*/ - - /conda_build_.*/ - - - python-3-5-conda: - requires: - - python-3.5-core - - python-3.5-optional -# - python-3.5-plot_ly - - python-3-5-orca - - filters: - branches: - only: - - master - - /release_.*/ - - /conda_build_.*/ - - - python-3-6-conda: - requires: - - python-3.6-core - - python-3.6-optional -# - python-3.6-plot_ly -# - python-3-6-orca - - filters: - branches: - only: - - master - - /release_.*/ - - /conda_build_.*/ - - - python-3-7-conda: - requires: - - python-3.7-core -# - python-3.7-optional - - python-3.7-plot_ly - - python-3-7-orca - - filters: - branches: - only: - - master - - /release_.*/ - - /conda_build_.*/ diff --git a/.circleci/create_conda_packages.sh b/.circleci/create_conda_packages.sh deleted file mode 100755 index 1ffe60a7530..00000000000 --- a/.circleci/create_conda_packages.sh +++ /dev/null @@ -1,19 +0,0 @@ -# Install conda dependencies -conda install -y conda-build conda-verify zip - -# Make artifacts directory (will be uploaded to CircleCI after build) -mkdir artifacts - -# Perform build -conda build --python $PYTHON_VERSION recipe/ > artifacts/conda-build.out.txt 2>&1 - -# Convert to other architectures -mkdir -p ./conda_packages_${PYTHON_VERSION}/linux-64/ -cp /opt/conda/conda-bld/linux-64/plotly-*.tar.bz2 ./conda_packages_${PYTHON_VERSION}/linux-64/ -conda convert -p linux-32 ./conda_packages_${PYTHON_VERSION}/linux-64/plotly-*.tar.bz2 -o ./conda_packages_${PYTHON_VERSION}/ -conda convert -p osx-64 ./conda_packages_${PYTHON_VERSION}/linux-64/plotly-*.tar.bz2 -o ./conda_packages_${PYTHON_VERSION}/ -conda convert -p win-64 ./conda_packages_${PYTHON_VERSION}/linux-64/plotly-*.tar.bz2 -o ./conda_packages_${PYTHON_VERSION}/ -conda convert -p win-32 ./conda_packages_${PYTHON_VERSION}/linux-64/plotly-*.tar.bz2 -o ./conda_packages_${PYTHON_VERSION}/ - -# zip up packages into artifacts directory -zip -r artifacts/conda_packages_${PYTHON_VERSION}.zip ./conda_packages_${PYTHON_VERSION}/ \ No newline at end of file diff --git a/contributing.md b/contributing.md index 3a529cef74e..294c758dafd 100644 --- a/contributing.md +++ b/contributing.md @@ -230,27 +230,6 @@ After all of the functionality for the release has been merged into master, create a branch named `release_X.Y.Z`. This branch will become the final version -#### Bump to release candidate version -Next increment the version of `plotly.py` to `X.Y.Zrc1`, and the version of -`plotlywidget` to `A.B.C-rc.1`. In both cases `rc` is the semantic versioning -code for Release Candidate. The number 1 means that this is the first release -candidate, this number can be incremented if we need to publish multiple -release candidates. Note that the `npm` suffix is `-rc.1` and the PyPI -suffix is `rc1`. - - - `plotly/version.py`: - + Update `__version__` to `X.Y.Zrc1` - + Update `__frontend_version__` to `^A.B.C-rc.1` (Note the `^` prefix) - - `js/package.json` - + Update `"version"` to `A.B.C-rc.1` - -Publishing `plotly.py` and `plotlywidget` as release candidates -allows us to go through the publication process, and test that the -installed packages work properly before general users will get them by -default. It also gives us the opportunity to ask specific users to test -that their bug reports are in fact resolved before we pull the trigger -on the official release. - #### Finalize changelog Review the contents of `CHANGELOG.md`. We try to follow the [keepachangelog](https://keepachangelog.com/en/1.0.0/) guidelines. Make sure @@ -278,6 +257,38 @@ of the dependencies. Use the release candidate versions, this way we can point people to the README of the `release_X.Y.Z` as the instructions for trying out the release candidate. +Note that the conda installation instructions must include +"-c plotly/lable/test" rather than "-c plotly" in order to install the +release candidate version. + +Commit Changelog and README updates. + +#### Bump to release candidate version + 1) Manually update the plotlywidget version to `A.B.C-rc.1` in the files +specified below. + + - `plotly/_widget_version.py`: + + Update `__frontend_version__` to `^A.B.C-rc.1` (Note the `^` prefix) + - `js/package.json` + + Update `"version"` to `A.B.C-rc.1` + + 2) Commit the changes + + 3) Tag this commit on the release branch as `vX.Y.Zrc1` and `widget-vA.B.C-rc.1` + +In both cases `rc` is the semantic versioning code for Release Candidate. + +The number 1 means that this is the first release candidate, this number can +be incremented if we need to publish multiple release candidates. +Note that the `npm` suffix is `-rc.1` and the PyPI suffix is `rc1`. + +Publishing `plotly.py` and `plotlywidget` as release candidates +allows us to go through the publication process, and test that the +installed packages work properly before general users will get them by +default. It also gives us the opportunity to ask specific users to test +that their bug reports are in fact resolved before we pull the trigger +on the official release. + #### Publish release candidate to PyPI To upload to PyPI you'll also need to have `twine` installed: ```bash @@ -285,7 +296,7 @@ To upload to PyPI you'll also need to have `twine` installed: ``` And, you'll need the credentials file `~/.pypirc`. Request access from -@theengineear and @chriddyp. Then, from inside the repository: +@jonmmease and @chriddyp. Then, from inside the repository: ```bash (plotly.py) $ git checkout release_X.Y.Z @@ -306,36 +317,13 @@ The `--tag next` part ensures that users won't install this version unless they explicitly ask for the version or for the version wtih the `next` tag. #### Publish release candidate to plotly anaconda channel -Conda packages are built automatically on circleci for each push where all -tests pass on `master` and `release_` branches. - -Conda packages for Python X.Y are included as "artifacts" of the circleci -job named `python-X-Y-conda`. - -First download the artifacts for each Python version: - - Click the "Details" button next to check named " ci/circleci: python-X-Y-conda". This will take you to the circleci dashboard for that job. - - Click on the "Artifacts" tab, and expend the directory tree to root/project/artifacts/conda_packages_X.Y.zip. - - Click to download this zip file. - -Then unzip all of the artifact zip files into the same directory. You should -end up with a directory structure like - - /path/to/packages - - conda_packages_2_7 - - win-64 - - plotly-X.Y.Z-py27_0.tar.bz2 - - win-32 - - plotly-X.Y.Z-py27_0.tar.bz2 - - linux-64 - - plotly-X.Y.Z-py27_0.tar.bz2 - - ... - - conda_packages_3_5 - - win-64 - - plotly-X.Y.Z-py35_0.tar.bz2 - - ... - - conda_packages_3_6 - - ... - - conda_packages_3_7 - - ... +To publish package to the plotly anaconda channel you'll need to have the +anaconda or miniconda distribution installed, and you'll need to have the +`anaconda-client` package installed. + +```bash +(plotly.py) $ conda build recipe/ +``` Next run `anaconda login` and enter the credentials for the plotly anaconda channel. @@ -345,20 +333,15 @@ label will ensure that people will only download the release candidate version if they explicitly request it. ``` -$ anaconda upload --label test /path/to/packages/conda_packages_*/*/plotly-*.tar.bz2 +$ anaconda upload --label test /path/to/anaconda3/conda-bld/noarch/plotly-*.tar.bz2 ``` Then logout with `anaconda logout` #### Manually test the release candidate Create a fresh virtual environment (or conda environment) and install -the release candidate by following the new `README.md` instructions, -replacing `X.Y.Z` with `X.Y.Zrc1` and `A.B.C` with `A.B.C-rc.1`. - -In particular - - `pip install plotly==X.Y.Z` -> `pip install plotly==X.Y.Zrc1` - - `jupyter labextension install plotlywidget@A.B.C` -> - `jupyter labextension install plotlywidget@A.B.C-rc.1` +the release candidate by following the new `README.md` instructions +(the instructions updated above to include the release candidate versions) Run through the example notebooks at https://github.com/jonmmease/plotly_ipywidget_notebooks using the classic @@ -372,22 +355,33 @@ If problems are found in the release candidate, fix them on the release branch and then publish another release candidate with the candidate number incremented. +#### Finalize CHANGELOG and README +Update CHANGELOG with release date and update README with final versions. + +In the conda installation instructions, be sure to change the +"-c plotly/lable/test" argument to "-c plotly" + +Commit updates. + #### Finalize versions When no problems are identified in the release candidate, remove the release candidate suffix from the following version strings: - - - `plotly/version.py`: - + Update `__version__` to `X.Y.Z` + + - `plotly/_widget_version.py`: + Update `__frontend_version__` to `^A.B.C` (Note the `^` prefix) - `js/package.json` + Update `"version"` to `A.B.C` + +Commit and push to the release branch. #### Merge release into master Make sure the integration tests are passing on the release branch, then merge it into master on GitHub. Make sure tests also pass on master, then update your local master, -tag this merge commit as `vX.Y.Z` (e.g. `v3.1.1`), and push the tag. +tag this merge commit as `vX.Y.Z` (e.g. `v3.1.1`) and `widget-vA.B.C` + +push the tag. ```bash (plotly.py) $ git checkout master @@ -395,6 +389,8 @@ tag this merge commit as `vX.Y.Z` (e.g. `v3.1.1`), and push the tag. (plotly.py) $ git pull origin master (plotly.py) $ git tag vX.Y.Z (plotly.py) $ git push origin vX.Y.Z +(plotly.py) $ git tag widget-vA.B.C +(plotly.py) $ git push origin widget-vA.B.C ``` #### Publishing to Pip @@ -427,12 +423,10 @@ npm publish --access public Follow the anaconda upload instructions as described for the release candidate above, except: - - Download the package artifacts from the circleci jobs that ran against - master. - Do not include the `--label test` argument when uploading ``` -$ anaconda upload /path/to/packages/conda_packages_*/*/plotly-*.tar.bz2 +$ anaconda upload /path/to/anaconda3/conda-bld/noarch/plotly-*.tar.bz2 ``` #### Add GitHub Release entry diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 7e0e55a63c5..47cee81cd94 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -11,6 +11,7 @@ source: build: number: 0 script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -q" + noarch: python requirements: build: @@ -47,4 +48,4 @@ about: extra: recipe-maintainers: - - jonmmease \ No newline at end of file + - jonmmease From b25edf2dc1c68b3377f370021ab4d98f8e8eead3 Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Wed, 6 Mar 2019 08:11:08 -0500 Subject: [PATCH 2/2] Run dev_build on all branches --- .circleci/config.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2b8d35d7c3a..85d6055d721 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -437,12 +437,7 @@ workflows: version: 2 dev_build: jobs: - - plotlyjs_dev_build: - filters: - branches: - only: - - master - - bleeding_edge + - plotlyjs_dev_build build: jobs: