diff --git a/.binder/environment.yml b/.binder/environment.yml index 617378f..b769289 100644 --- a/.binder/environment.yml +++ b/.binder/environment.yml @@ -1,11 +1,9 @@ channels: - conda-forge - dependencies: - python>=3.6 - pytest - - jupyterlab + - jupyterlab>=2.0.0,<3.0.0 - cookiecutter - nodejs - git - - yarn diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..262bef0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,40 @@ +name: Publish Package + +on: + release: + types: [published] + + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install node + uses: actions/setup-node@v1 + with: + node-version: '14.x' + registry-url: 'https://registry.npmjs.org' + - name: Install Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install jupyterlab setuptools twine wheel + - name: Publish the Python package + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* + - name: Publish the NPM package + run: | + echo $PRE_RELEASE + if [[ $PRE_RELEASE == "true" ]]; then export TAG="next"; else export TAG="latest"; fi + npm publish --tag ${TAG} --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + PRE_RELEASE: ${{ github.event.release.prerelease }} diff --git a/LICENSE b/LICENSE index 4e944eb..ec501c1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011, Hadrien Mary +Copyright (c) 2011-2020, Hadrien Mary, Frederic Collonval All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index d41db73..1c1a82a 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,9 @@ [![Build Status](https://travis-ci.com/hadim/jupyter-archive.svg?branch=master)](https://travis-ci.com/hadim/jupyter-archive) [![Version](https://img.shields.io/npm/v/@hadim/jupyter-archive.svg)](https://www.npmjs.com/package/@hadim/jupyter-archive) [![PyPI](https://img.shields.io/pypi/v/jupyter-archive)](https://pypi.org/project/jupyter-archive/) +[![Conda (channel only)](https://img.shields.io/conda/vn/conda-forge/jupyter-archive)](https://anaconda.org/conda-forge/jupyter-archive) -A Jupyter/Jupyterlab extension to make, download and extract archive files. +A Jupyterlab extension to make, download and extract archive files. Features: @@ -17,11 +18,11 @@ Features: - Decompress an archive directly in file browser. - Notebok client extension not available. [Contributions are welcome](https://github.com/hadim/jupyter-archive/issues/21). -![jupyter-archive in action](./archive.gif "jupyter-archive in action.") +![jupyter-archive in action](https://raw.githubusercontent.com/hadim/jupyter-archive/master/archive.gif) ## Prerequisites -- JupyterLab +- JupyterLab >=2.0.0,<3.0.0 ## Installation @@ -35,12 +36,13 @@ jupyter lab build Using `conda`: ```bash -conda install jupyter-archive +conda install -c conda-forge nodejs jupyter-archive +jupyter lab build ``` This will install both the server extension and the Jupyterlab extension needed by the plugin. -You can also install the labextension via Jupyterlab's extension manager GUI. Keep in mind that if you use the GUI, you'll still need to install the `jupyterlab-archive` server extension via `pip` or `conda`. +You can also install the labextension via Jupyterlab's extension manager GUI. Keep in mind that if you use the GUI, you'll still need to install the `jupyter-archive` server extension via `pip` or `conda`. ## Development diff --git a/environment.yml b/environment.yml index 78ee70f..d2817fe 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,7 @@ channels: dependencies: - python>=3.6 - pytest - - jupyterlab + - jupyterlab>=2.0.0,<3.0.0 - cookiecutter - nodejs - git diff --git a/jupyter_archive/_version.py b/jupyter_archive/_version.py index 7a47771..e9aff14 100644 --- a/jupyter_archive/_version.py +++ b/jupyter_archive/_version.py @@ -1,4 +1,4 @@ # Copyright (c) Project Jupyter. # Distributed under the terms of the Modified BSD License. -__version__ = '0.7.1-dev' +__version__ = '2.0.0' diff --git a/package.json b/package.json index 137ec1f..9fc35bd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@hadim/jupyter-archive", - "version": "0.7.1-dev", - "description": "A Jupyter/Jupyterlab extension to make, download and extract archive files.", + "version": "2.0.0", + "description": "A Jupyterlab extension to make, download and extract archive files.", "keywords": [ "jupyter", "jupyterlab", diff --git a/rever.xsh b/rever.xsh deleted file mode 100644 index f8c9db8..0000000 --- a/rever.xsh +++ /dev/null @@ -1,38 +0,0 @@ -from rever.activities.command import command - -command('run_tests', 'pytest jupyter_archive/', '') -command('publish_npm', 'yarn publish --access=public --new-version $VERSION', '') - -$PROJECT = 'jupyter-archive' - -$ACTIVITIES = ['version_bump', 'tag', 'push_tag', 'pypi', 'publish_npm', 'ghrelease', 'bump_to_dev', 'push_tag'] - -$VERSION_BUMP_PATTERNS = [('jupyter_archive/_version.py', '__version__\s*=.*', "__version__ = '$VERSION'"), - ('package.json', '"version"\s*:.*,', '"version": "$VERSION",')] - -$PUSH_TAG_REMOTE = 'git@github.com:hadim/jupyter-archive.git' -$GITHUB_ORG = 'hadim' -$GITHUB_REPO = 'jupyter-archive' - -from rever.activity import activity -from rever.tools import eval_version, replace_in_file -from rever import vcsutils - - -@activity -def bump_to_dev(): - def increment_version(version): - """Increment a version by 0.0.1""" - version = version.split('.') - version[2] = str(int(version[2]) + 1) - return '.'.join(version) - - # Increment to a new version and add '-dev' flag. - new_version = increment_version($VERSION) - new_version += "-dev" - - for f, p, n in $VERSION_BUMP_PATTERNS: - n = n.replace("$VERSION", new_version) - n = eval_version(n) - replace_in_file(p, n, f) - vcsutils.commit('Bump to dev') diff --git a/setup.py b/setup.py index 6e8bab1..0cbae45 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +import pathlib from os.path import join as pjoin from setuptools import find_packages, setup @@ -46,10 +47,11 @@ setup( name=name.replace("_", "-"), version=version, - author="Hadrien Mary", - author_email="hadrien.mary@gmail.com", + author="Hadrien Mary, Frederic Collonval", + author_email="hadrien.mary@gmail.com, fcollonval@gmail.com", url="https://github.com/hadim/jupyter-archive/", description="A Jupyter/Jupyterlab extension to make, download and extract archive files.", + long_description=(pathlib.Path(HERE) / "README.md").read_text(), long_description_content_type="text/markdown", cmdclass=cmdclass, packages=find_packages(), @@ -65,4 +67,5 @@ include_package_data=True, install_requires=["notebook"], extras_require={"test": ["jupyterlab", "pytest"]}, + python_requires=">=3.5,<4" )