diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml new file mode 100644 index 0000000..3e02156 --- /dev/null +++ b/.github/workflows/check-release.yml @@ -0,0 +1,22 @@ +name: Check Release +on: + push: + branches: ["main"] + pull_request: + branches: ["*"] + +jobs: + check_release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - name: Install Dependencies + run: | + pip install -e . + - name: Check Release + uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/enforce-label.yml b/.github/workflows/enforce-label.yml new file mode 100644 index 0000000..725feab --- /dev/null +++ b/.github/workflows/enforce-label.yml @@ -0,0 +1,13 @@ +name: Enforce PR label + +on: + pull_request: + types: [labeled, unlabeled, opened, edited, synchronize] +jobs: + enforce-label: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: enforce-triage-label + uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1 diff --git a/.github/workflows/prep-release.yml b/.github/workflows/prep-release.yml new file mode 100644 index 0000000..7a2a18d --- /dev/null +++ b/.github/workflows/prep-release.yml @@ -0,0 +1,42 @@ +name: "Step 1: Prep Release" +on: + workflow_dispatch: + inputs: + version_spec: + description: "New Version Specifier" + default: "next" + required: false + branch: + description: "The branch to target" + required: false + post_version_spec: + description: "Post Version Specifier" + required: false + since: + description: "Use PRs with activity since this date or git reference" + required: false + since_last_stable: + description: "Use PRs with activity since the last stable git tag" + required: false + type: boolean +jobs: + prep_release: + runs-on: ubuntu-latest + steps: + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + + - name: Prep Release + id: prep-release + uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2 + with: + token: ${{ secrets.ADMIN_GITHUB_TOKEN }} + version_spec: ${{ github.event.inputs.version_spec }} + post_version_spec: ${{ github.event.inputs.post_version_spec }} + target: ${{ github.event.inputs.target }} + branch: ${{ github.event.inputs.branch }} + since: ${{ github.event.inputs.since }} + since_last_stable: ${{ github.event.inputs.since_last_stable }} + + - name: "** Next Step **" + run: | + echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}" diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 0000000..dbaaeaa --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,54 @@ +name: "Step 2: Publish Release" +on: + workflow_dispatch: + inputs: + branch: + description: "The target branch" + required: false + release_url: + description: "The URL of the draft GitHub release" + required: false + steps_to_skip: + description: "Comma separated list of steps to skip" + required: false + +jobs: + publish_release: + runs-on: ubuntu-latest + steps: + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + + - name: Populate Release + id: populate-release + uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2 + with: + token: ${{ secrets.ADMIN_GITHUB_TOKEN }} + target: ${{ github.event.inputs.target }} + branch: ${{ github.event.inputs.branch }} + release_url: ${{ github.event.inputs.release_url }} + steps_to_skip: ${{ github.event.inputs.steps_to_skip }} + + - name: Finalize Release + id: finalize-release + env: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }} + TWINE_USERNAME: __token__ + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2 + with: + token: ${{ secrets.ADMIN_GITHUB_TOKEN }} + target: ${{ github.event.inputs.target }} + release_url: ${{ steps.populate-release.outputs.release_url }} + + - name: "** Next Step **" + if: ${{ success() }} + run: | + echo "Verify the final release" + echo ${{ steps.finalize-release.outputs.release_url }} + + - name: "** Failure Message **" + if: ${{ failure() }} + run: | + echo "Failed to Publish the Draft Release Url:" + echo ${{ steps.populate-release.outputs.release_url }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 49d39e5..0f95779 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -80,6 +80,19 @@ jobs: run: | pytest -vv || pytest -vv --lf + check_docs: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v2 + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - name: "Build docs" + run: | + pip install -e . + cd docs + pip install -r requirements.txt + make html SPHINXOPTS='-W' + make_sdist: name: Make SDist runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index c11ce42..e7addad 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ __pycache__ htmlcov .cache .idea +docs/changelog.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a511982..09c0e39 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,10 +28,18 @@ repos: files: \.py$ args: [--profile=black] - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.4 + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.10.1 hooks: - - id: prettier + - id: validate-pyproject + stages: [manual] + + - repo: https://github.com/executablebooks/mdformat + rev: 0.7.16 + hooks: + - id: mdformat + additional_dependencies: + [mdformat-gfm, mdformat-frontmatter, mdformat-footnote] - repo: https://github.com/asottile/pyupgrade rev: v3.2.0 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..dd206dd --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,343 @@ +# Changes in jupyter-core + + + +## 5.0.0rc0 + +[on +GitHub](https://github.com/jupyter/jupyter_core/releases/tag/5.0.0rc0) + +- Try to detect if we are in a virtual environment and change path + precedence accordingly. ([#286](https://github.com/jupyter/jupyter_core/pull/286)) +- Update broken link to Contributing guide. + ([#289](https://github.com/jupyter/jupyter_core/pull/289)) +- Add current working directory as first config path. + ([#291](https://github.com/jupyter/jupyter_core/pull/291)) +- Use platformdirs for path locations. ([#292](https://github.com/jupyter/jupyter_core/pull/292)) + + + +## 4.11 + +### 4.11.1 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.11.1) + +- Fix inclusion of jupyter file and check in CI. + ([#276](https://github.com/jupyter/jupyter_core/pull/276)) + +### 4.11.0 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.11.0) + +- Use hatch build backend. ([#265](https://github.com/jupyter/jupyter_core/pull/265)) +- `is_hidden`: Use normalized paths. ([#271](https://github.com/jupyter/jupyter_core/pull/271)) + +## 4.10 + +### 4.10.0 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.10.0) + +- Include all files from `jupyter_core`. ([#253](https://github.com/jupyter/jupyter_core/pull/253)) +- Add project URLs to `setup.cfg`. ([#254](https://github.com/jupyter/jupyter_core/pull/254)) +- Set up pre-commit. ([#255](https://github.com/jupyter/jupyter_core/pull/255)) +- Add flake8 and mypy settings. ([#256](https://github.com/jupyter/jupyter_core/pull/256)) +- Clean up CI. ([#258](https://github.com/jupyter/jupyter_core/pull/258)) + +## 4.9 + +### 4.9.2 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.9.1) + +- Set proper `sys.argv[0]` for subcommand. ([#248](https://github.com/jupyter/jupyter_core/pull/248)) +- Add explicit encoding in open calls. ([#249](https://github.com/jupyter/jupyter_core/pull/249)) +- `jupyter_config_dir` - reorder `home_dir` initialization. + ([#251](https://github.com/jupyter/jupyter_core/pull/251)) + +### 4.9.1 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.9.0) + +- Add a workaround for virtualenv for getting the user site directory. + ([#247](https://github.com/jupyter/jupyter_core/pull/247)) + +### 4.9.0 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.9.0) + +See the [jupyter_core +4.9](https://github.com/jupyter/jupyter_core/milestone/21?closed=1) +milestone on GitHub for the full list of pull requests and issues +closed. + +- Add Python site user base subdirectories to config and data + user-level paths if `site.ENABLE_USER_SITE` is True. One way to + disable these directory additions is to set the `PYTHONNOUSERSITE` + environment variable. These locations can be customized by setting + the `PYTHONUSERBASE` environment variable. ([#242](https://github.com/jupyter/jupyter_core/pull/242)) + +## 4.8 + +### 4.8.2 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.8.2) + +jupyter_core 4.8.1 was released the same day as 4.8.0 and also included +the fix below for the Windows tests. Unfortunately, the 4.8.1 release +commit and tag were not pushed to GitHub. We are releasing 4.8.2 so we +have a commit and tag in version control. + +- Fix windows test regression ([#240](https://github.com/jupyter/jupyter_core/pull/240)) + +### 4.8.0 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.8.0) + +See the [jupyter_core +4.8](https://github.com/jupyter/jupyter_core/milestone/20?closed=1) +milestone on GitHub for the full list of pull requests and issues +closed. + +jupyter-core now has experimental support for PyPy (Python 3.7). Some +features are known not to work due to limitations in PyPy, such as +hidden file detection on Windows. + +- Print an error message instead of an exception when a command is not + found ([#218](https://github.com/jupyter/jupyter_core/pull/218)) +- Return canonical path when using `%APPDATA%` on Windows + ([#222](https://github.com/jupyter/jupyter_core/pull/222)) +- Print full usage on missing or invalid commands + ([#225](https://github.com/jupyter/jupyter_core/pull/225)) +- Remove dependency on `pywin32` package on PyPy + ([#230](https://github.com/jupyter/jupyter_core/pull/230)) +- Update packages listed in `jupyter --version` + ([#232](https://github.com/jupyter/jupyter_core/pull/232)) +- Inherit base aliases/flags from traitlets Application, including + `--show-config` from traitlets 5 ([#233](https://github.com/jupyter/jupyter_core/pull/233)) +- Trigger warning when trying to check hidden file status on PyPy + ([#238](https://github.com/jupyter/jupyter_core/pull/238)) + +## 4.7 + +### 4.7.1 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.7.1) + +- Allow creating user to delete secure file ([#213](https://github.com/jupyter/jupyter_core/pull/213)) + +### 4.7.0 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.7.0) + +See the [jupyter_core +4.7](https://github.com/jupyter/jupyter_core/milestone/19?closed=1) +milestone on GitHub for the full list of pull requests and issues +closed. + +- Add a new `JUPYTER_PREFER_ENV_PATH` variable, which can be set to + switch the order of the environment-level path and the user-level + path in the Jupyter path hierarchy (e.g., `jupyter --paths`). It is + considered set if it is a value that is not one of 'no', 'n', + 'off', 'false', '0', or '0.0' (case insensitive). If you are + running Jupyter in multiple virtual environments as the same user, + you will likely want to set this environment variable. +- Drop Python 2.x and 3.5 support, as they have reached end of life. +- Add Python 3.9 builds to testing, and expand testing to cover + Windows, macOS, and Linux platforms. +- `jupyter --paths --debug` now explains the environment variables + that affect the current path list. +- Update the file hidden check on Windows to use new Python features + rather than ctypes directly. +- Add conda environment information in `jupyter troubleshoot`. +- Update `_version.version_info` and `_version.__version__` to follow + Python conventions. + +## 4.6 + +### 4.6.3 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.6.3) + +- Changed windows secure_write path to skip all filesystem permission + checks when running in insecure mode. Too many exception paths + existed for mounted file systems to reliably try to set them before + opting out with the insecure write pattern. + +### 4.6.2 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.6.2) + +- Add ability to allow insecure writes with + JUPYTER_ALLOW_INSECURE_WRITES environement variable + ([#182](https://github.com/jupyter/jupyter_core/pull/182)). +- Docs typo and build fixes +- Added python 3.7 and 3.8 builds to testing + +### 4.6.1 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.6.1) + +- Tolerate execute bit in owner permissions when validating secure + writes ([#173](https://github.com/jupyter/jupyter_core/pull/173)). +- Fix project name typo in copyright ([#171](https://github.com/jupyter/jupyter_core/pull/171)). + +### 4.6.0 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.6.0) + +- Unicode characters existing in the user's home directory name are + properly handled ([#131](https://github.com/jupyter/jupyter_core/pull/131)). +- `mock` is now only required for testing on Python 2 + ([#157](https://github.com/jupyter/jupyter_core/pull/157)). +- Deprecation warnings relative to `_runtime_dir_changed` are no + longer produced ([#158](https://github.com/jupyter/jupyter_core/pull/158)). +- The `scripts` directory relative to the current python environment + is now appended to the search directory for subcommands + ([#162](https://github.com/jupyter/jupyter_core/pull/162)). +- Some utility functions (`exists()`, `is_hidden()`, `secure_write()`) + have been moved from `jupyter_client` and `jupyter_server` to + `jupyter_core` ([#163](https://github.com/jupyter/jupyter_core/pull/163)). +- Fix error on Windows when setting private permissions + ([#166](https://github.com/jupyter/jupyter_core/pull/166)). + +## 4.5 + +### 4.5.0 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.5.0) + +- `jupyter --version` now tries to show the version number of various + other installed Jupyter packages, not just `jupyter_core` + ([#136](https://github.com/jupyter/jupyter_core/pull/136)). This will hopefully make + it clearer that there are various packages with their own version + numbers. +- Allow a `JUPYTER_CONFIG_PATH` + environment variable to specify a search path of additional + locations for config ([#139](https://github.com/jupyter/jupyter_core/pull/139)). +- `jupyter subcommand` no longer modifies the `PATH` environment variable when it runs + `jupyter-subcommand` ([#148](https://github.com/jupyter/jupyter_core/pull/148)). +- Jupyter's 'runtime' directory no longer uses `XDG_RUNTIME_DIR` + ([#143](https://github.com/jupyter/jupyter_core/pull/143)). While it has some + attractive properties, it has led to various problems; see the pull + request for details. +- Fix `JupyterApp` to respect the `raise_config_file_errors` traitlet + ([#149](https://github.com/jupyter/jupyter_core/pull/149)). +- Various improvements to the bash completion scripts in this + repository ([#125](https://github.com/jupyter/jupyter_core/pull/125), + [#126](https://github.com/jupyter/jupyter_core/pull/126)). +- The `setup.py` script now always uses setuptools, like most other + Jupyter projects ([#147](https://github.com/jupyter/jupyter_core/pull/147)). +- The LICENSE file is included in wheels ([#133](https://github.com/jupyter/jupyter_core/pull/133)). + +## 4.4 + +### 4.4.0 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.4.0) + +- `jupyter troubleshoot` gets the list of packages from the Python + environment it's in, by using `sys.executable` to call `pip list` + ([#104](https://github.com/jupyter/jupyter_core/pull/104)). +- Added utility function `ensure_dir_exists`, and switched to using it + over the one from ipython_genutils, which does permissions wrong + ([#113](https://github.com/jupyter/jupyter_core/pull/113)). +- Avoid creating the `~/.ipython` directory when checking if it exists + for config migration ([#118](https://github.com/jupyter/jupyter_core/pull/118)). +- Fix mistaken description in zsh completions ([#98](https://github.com/jupyter/jupyter_core/pull/98)). +- Fix subcommand tests on Windows ([#103](https://github.com/jupyter/jupyter_core/pull/103)). +- The README now describes how to work on `jupyter_core` and build the + docs ([#110](https://github.com/jupyter/jupyter_core/pull/110)). +- Fix a broken link to a release in the docs ([#109](https://github.com/jupyter/jupyter_core/pull/109)). + +## 4.3 + +### 4.3.0 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.3.0) + +- Add `JUPYTER_NO_CONFIG` environment variable for + disabling all Jupyter configuration. +- More detailed error message when failing to launch subcommands. + +## 4.2 + +### 4.2.1 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.2.1) + +- Fix error message on Windows when subcommand not found. +- Correctly display PATH in `jupyter troubleshoot` on Windows. + +### 4.2.0 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.2.0) + +- Make `jupyter` directory top + priority in search path for subcommands, so that + `jupyter-subcommand` next to + `jupyter` will always be picked if + present. +- Avoid using `shell=True` for subcommand dispatch on Windows. + +## 4.1 + +### 4.1.1 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.1.1) + +- Include symlink directory and real location on subcommand PATH when + `jupyter` is a symlink. + +### 4.1.0 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.1.0) + +- Add `jupyter.py` module, so that + `python -m jupyter` always works. +- Add prototype `jupyter troubleshoot` command for displaying + environment info. +- Ensure directory containing `jupyter` executable is included when + dispatching subcommands. +- Unicode fixes for Legacy Python. + +## 4.0 + +### 4.0.6 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.0.6) + +- fix typo preventing migration when custom.css is missing + +### 4.0.5 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.0.5) + +- fix subcommands on Windows (yes, again) +- fix migration when custom.js/css are not present + +### 4.0.4 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.0.4) + +- fix subcommands on Windows (again) +- ensure `jupyter --version` outputs to stdout + +### 4.0.3 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.0.3) + +- setuptools fixes needed to run on Windows + +### 4.0.2 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.0.2) + +- fixes for jupyter-migrate + +### 4.0.1 + +[on GitHub](https://github.com/jupyter/jupyter_core/releases/tag/4.0.1) + +This is the first release of the jupyter-core package. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4aa1aac..9afe31d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ # Contributing -We follow the [IPython Contributing Guide](https://github.com/ipython/ipython/blob/master/CONTRIBUTING.md). +We follow the [Jupyter Contributing Guide](https://docs.jupyter.org/en/latest/contributing/content-contributor.html). See the [README](https://github.com/jupyter/jupyter_core/blob/master/README.md) on how to set up a development environment. diff --git a/COPYING.md b/COPYING.md index d85f84b..a15987c 100644 --- a/COPYING.md +++ b/COPYING.md @@ -57,5 +57,7 @@ change to one of the Jupyter repositories. With this in mind, the following banner should be used in any source code file to indicate the copyright and license terms: - # Copyright (c) Jupyter Development Team. - # Distributed under the terms of the Modified BSD License. +``` +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. +``` diff --git a/README.md b/README.md index c55719e..c83d29b 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,11 @@ You'll need Python and `pip` on the search path. Clone the Jupyter Core git repo Now create an [editable install](https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs) and download the dependencies of code and test suite by executing: - cd /my/projects/jupyter_core/ - pip install -e ".[test]" - py.test +``` +cd /my/projects/jupyter_core/ +pip install -e ".[test]" +py.test +``` The last command runs the test suite to verify the setup. During development, you can pass filenames to `py.test`, and it will execute only those tests. @@ -55,15 +57,19 @@ yourself after that. ## Documentation -The documentation of Jupyter Core is generated from the files in `docs/` using Sphinx. Instructions for setting up Sphinx with a selection of optional modules are in the [Documentation Guide](http://jupyter.readthedocs.io/en/latest/contrib_docs/index.html). You'll also need the `make` command. +The documentation of Jupyter Core is generated from the files in `docs/` using Sphinx. Instructions for setting up Sphinx with a selection of optional modules are in the [Documentation Guide](https://docs.jupyter.org/en/latest/contributing/content-contributor.html). You'll also need the `make` command. For a minimal Sphinx installation to process the Jupyter Core docs, execute: - pip install sphinx +``` +pip install sphinx +``` The following commands build the documentation in HTML format and check for broken links: - cd /my/projects/jupyter_core/docs/ - make html linkcheck +``` +cd /my/projects/jupyter_core/docs/ +make html linkcheck +``` Point your browser to the following URL to access the generated documentation: diff --git a/docs/changelog.rst b/docs/changelog.rst deleted file mode 100644 index ca8c1e7..0000000 --- a/docs/changelog.rst +++ /dev/null @@ -1,372 +0,0 @@ -Changes in jupyter-core -======================= - -5.0 ---- - -5.0.0rc0 -~~~~~~~~ - -`on -GitHub `__ - -* Try to detect if we are in a virtual environment and change path precedence accordingly. (:ghpull:`286`) -* Update broken link to `Contributing` guide. (:ghpull:`289`) -* Add current working directory as first config path. (:ghpull:`291`) -* Use platformdirs for path locations. (:ghpull:`292`) - - -4.11 ----- - -4.11.1 -~~~~~~ - -`on -GitHub `__ - -* Fix inclusion of jupyter file and check in CI. (:ghpull:`276`) - -4.11.0 -~~~~~~ - -`on -GitHub `__ - -* Use hatch build backend. (:ghpull:`265`) -* ``is_hidden``: Use normalized paths. (:ghpull:`271`) - -4.10 ----- - -4.10.0 -~~~~~~ - -`on -GitHub `__ - -* Include all files from ``jupyter_core``. (:ghpull:`253`) -* Add project URLs to ``setup.cfg``. (:ghpull:`254`) -* Set up pre-commit. (:ghpull:`255`) -* Add flake8 and mypy settings. (:ghpull:`256`) -* Clean up CI. (:ghpull:`258`) - -4.9 ---- - -4.9.2 -~~~~~ - -`on -GitHub `__ - -* Set proper ``sys.argv[0]`` for subcommand. (:ghpull:`248`) -* Add explicit encoding in open calls. (:ghpull:`249`) -* ``jupyter_config_dir`` - reorder ``home_dir`` initialization. (:ghpull:`251`) - -4.9.1 -~~~~~ - -`on -GitHub `__ - -- Add a workaround for virtualenv for getting the user site directory. (:ghpull:`247`) - - -4.9.0 -~~~~~ - -`on -GitHub `__ - -See the `jupyter_core -4.9 `__ -milestone on GitHub for the full list of pull requests and issues closed. - -- Add Python site user base subdirectories to config and data user-level paths - if ``site.ENABLE_USER_SITE`` is True. One way to disable these directory - additions is to set the ``PYTHONNOUSERSITE`` environment variable. These - locations can be customized by setting the ``PYTHONUSERBASE`` environment - variable. (:ghpull:`242`) - - -4.8 ---- - -4.8.2 -~~~~~ -`on -GitHub `__ - -jupyter_core 4.8.1 was released the same day as 4.8.0 and also included the fix -below for the Windows tests. Unfortunately, the 4.8.1 release commit and tag -were not pushed to GitHub. We are releasing 4.8.2 so we have a commit and tag -in version control. - -- Fix windows test regression (:ghpull:`240`) - -4.8.0 -~~~~~ - -`on -GitHub `__ - -See the `jupyter_core -4.8 `__ -milestone on GitHub for the full list of pull requests and issues closed. - -jupyter-core now has experimental support for PyPy (Python 3.7). Some features are known not to work due to limitations in PyPy, such as hidden file detection on Windows. - -- Print an error message instead of an exception when a command is not found (:ghpull:`218`) -- Return canonical path when using ``%APPDATA%`` on Windows (:ghpull:`222`) -- Print full usage on missing or invalid commands (:ghpull:`225`) -- Remove dependency on ``pywin32`` package on PyPy (:ghpull:`230`) -- Update packages listed in ``jupyter --version`` (:ghpull:`232`) -- Inherit base aliases/flags from traitlets Application, including ``--show-config`` from traitlets 5 (:ghpull:`233`) -- Trigger warning when trying to check hidden file status on PyPy (:ghpull:`238`) - -4.7 ---- - -4.7.1 -~~~~~ - -`on -GitHub `__ - -- Allow creating user to delete secure file (:ghpull:`213`) - -4.7.0 -~~~~~ - -`on -GitHub `__ - -See the `jupyter_core -4.7 `__ -milestone on GitHub for the full list of pull requests and issues closed. - -- Add a new ``JUPYTER_PREFER_ENV_PATH`` variable, which can be set to switch - the order of the environment-level path and the user-level path in the - Jupyter path hierarchy (e.g., ``jupyter --paths``). It is considered set if - it is a value that is not one of 'no', 'n', 'off', 'false', '0', or '0.0' - (case insensitive). If you are running Jupyter in multiple virtual - environments as the same user, you will likely want to set this environment - variable. -- Drop Python 2.x and 3.5 support, as they have reached end of life. -- Add Python 3.9 builds to testing, and expand testing to cover Windows, macOS, and Linux platforms. -- ``jupyter --paths --debug`` now explains the environment variables that affect the current path list. -- Update the file hidden check on Windows to use new Python features rather than ctypes directly. -- Add conda environment information in ``jupyter troubleshoot``. -- Update ``_version.version_info`` and ``_version.__version__`` to follow Python conventions. - -4.6 ---- - -4.6.3 -~~~~~ - -`on -GitHub `__ - -- Changed windows secure_write path to skip all filesystem permission checks when running in insecure mode. - Too many exception paths existed for mounted file systems to reliably try to set them before opting out with the insecure write pattern. - - -4.6.2 -~~~~~ - -`on -GitHub `__ - -- Add ability to allow insecure writes with JUPYTER_ALLOW_INSECURE_WRITES environement variable (:ghpull:`182`). -- Docs typo and build fixes -- Added python 3.7 and 3.8 builds to testing - -4.6.1 -~~~~~ - -`on -GitHub `__ - -- Tolerate execute bit in owner permissions when validating secure writes (:ghpull:`173`). -- Fix project name typo in copyright (:ghpull:`171`). - -4.6.0 -~~~~~ - -`on -GitHub `__ - -- Unicode characters existing in the user's home directory name are properly - handled (:ghpull:`131`). -- ``mock`` is now only required for testing on Python 2 (:ghpull:`157`). -- Deprecation warnings relative to ``_runtime_dir_changed`` are no longer - produced (:ghpull:`158`). -- The ``scripts`` directory relative to the current python environment is - now appended to the search directory for subcommands (:ghpull:`162`). -- Some utility functions (``exists()``, ``is_hidden()``, ``secure_write()``) - have been moved from ``jupyter_client`` and ``jupyter_server`` to - ``jupyter_core`` (:ghpull:`163`). -- Fix error on Windows when setting private permissions (:ghpull:`166`). - -4.5 ---- - -4.5.0 -~~~~~ - -`on -GitHub `__ - -- ``jupyter --version`` now tries to show the version number of various other - installed Jupyter packages, not just ``jupyter_core`` (:ghpull:`136`). - This will hopefully make it clearer that there are various packages with - their own version numbers. -- Allow a :envvar:`JUPYTER_CONFIG_PATH` environment variable to specify a - search path of additional locations for config (:ghpull:`139`). -- ``jupyter subcommand`` no longer modifies the :envvar:`PATH` environment - variable when it runs ``jupyter-subcommand`` (:ghpull:`148`). -- Jupyter's 'runtime' directory no longer uses ``XDG_RUNTIME_DIR`` - (:ghpull:`143`). While it has some attractive properties, it has led to - various problems; see the pull request for details. -- Fix ``JupyterApp`` to respect the ``raise_config_file_errors`` traitlet - (:ghpull:`149`). -- Various improvements to the bash completion scripts in this repository - (:ghpull:`125`, :ghpull:`126`). -- The ``setup.py`` script now always uses setuptools, like most other Jupyter - projects (:ghpull:`147`). -- The LICENSE file is included in wheels (:ghpull:`133`). - -4.4 ---- - -4.4.0 -~~~~~ - -`on -GitHub `__ - -- ``jupyter troubleshoot`` gets the list of packages from the Python environment - it's in, by using ``sys.executable`` to call ``pip list`` (:ghpull:`104`). -- Added utility function ``ensure_dir_exists``, and switched to using it over - the one from ipython_genutils, which does permissions wrong (:ghpull:`113`). -- Avoid creating the ``~/.ipython`` directory when checking if it exists for - config migration (:ghpull:`118`). -- Fix mistaken description in zsh completions (:ghpull:`98`). -- Fix subcommand tests on Windows (:ghpull:`103`). -- The README now describes how to work on ``jupyter_core`` and build the docs - (:ghpull:`110`). -- Fix a broken link to a release in the docs (:ghpull:`109`). - -4.3 ---- - -4.3.0 -~~~~~ - -`on -GitHub `__ - -- Add `JUPYTER_NO_CONFIG` environment variable for disabling all Jupyter configuration. -- More detailed error message when failing to launch subcommands. - - -4.2 ---- - -4.2.1 -~~~~~ - -`on -GitHub `__ - -- Fix error message on Windows when subcommand not found. -- Correctly display PATH in ``jupyter troubleshoot`` on Windows. - -4.2.0 -~~~~~ - -`on -GitHub `__ - -- Make :command:`jupyter` directory top priority in search path for subcommands, - so that :command:`jupyter-subcommand` next to :command:`jupyter` will always be picked if present. -- Avoid using ``shell=True`` for subcommand dispatch on Windows. - -4.1 ---- - -4.1.1 -~~~~~ - -`on -GitHub `__ - -- Include symlink directory and real location on subcommand PATH when :file:`jupyter` is a symlink. - - -4.1.0 -~~~~~ - -`on -GitHub `__ - -- Add ``jupyter.py`` module, so that :command:`python -m jupyter` always works. -- Add prototype ``jupyter troubleshoot`` command for displaying environment info. -- Ensure directory containing ``jupyter`` executable is included when dispatching subcommands. -- Unicode fixes for Legacy Python. - - -4.0 ---- - -4.0.6 -~~~~~ - -`on -GitHub `__ - -- fix typo preventing migration when custom.css is missing - -4.0.5 -~~~~~ - -`on -GitHub `__ - -- fix subcommands on Windows (yes, again) -- fix migration when custom.js/css are not present - -4.0.4 -~~~~~ - -`on -GitHub `__ - -- fix subcommands on Windows (again) -- ensure ``jupyter --version`` outputs to stdout - -4.0.3 -~~~~~ - -`on -GitHub `__ - -- setuptools fixes needed to run on Windows - -4.0.2 -~~~~~ - -`on -GitHub `__ - -- fixes for jupyter-migrate - -4.0.1 -~~~~~ - -`on -GitHub `__ - -This is the first release of the jupyter-core package. diff --git a/docs/conf.py b/docs/conf.py index 744215d..3654d04 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,6 +12,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. +import os +import shutil + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -26,6 +29,7 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ + "myst_parser", "sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinxcontrib_github_alt", @@ -59,7 +63,7 @@ # built documents. # # The short X.Y version. -version = "%d.%d" % version_info[:2] +version = "%d.%d" % version_info[:2] # type:ignore[str-format] # The full version, including alpha/beta/rc tags. release = __version__ @@ -68,7 +72,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: @@ -141,7 +145,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] +# html_static_path = ["_static"] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied @@ -286,3 +290,8 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {"https://docs.python.org/3/": None} + + +def setup(app): + here = os.path.dirname(os.path.abspath(__file__)) + shutil.copy(os.path.join(here, "..", "CHANGELOG.md"), "changelog.md") diff --git a/docs/requirements.txt b/docs/requirements.txt index 3183dd0..ef66f70 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,3 @@ +myst-parser sphinxcontrib_github_alt traitlets>=4.0 diff --git a/jupyter_core/version.py b/jupyter_core/version.py index 4c4b975..37b932d 100644 --- a/jupyter_core/version.py +++ b/jupyter_core/version.py @@ -1,20 +1,17 @@ -# Copyright (c) Jupyter Development Team. -# Distributed under the terms of the Modified BSD License. +""" +store the current version info of the jupyter_core. +""" +import re +from typing import List -from collections import namedtuple - -VersionInfo = namedtuple("VersionInfo", ["major", "minor", "micro", "releaselevel", "serial"]) - -version_info = VersionInfo(5, 0, 0, "candidate", 2) +# Version string must appear intact for hatch versioning __version__ = "5.0.0rc2" -_specifier_ = {"alpha": "a", "beta": "b", "candidate": "rc", "final": "", "dev": "dev"} - -if version_info.releaselevel == "final": - _suffix_ = "" -elif version_info.releaselevel == "dev": - _suffix_ = f".dev{version_info.serial}" -else: - _suffix_ = f"{_specifier_[version_info.releaselevel]}{version_info.serial}" - -assert __version__ == f"{version_info.major}.{version_info.minor}.{version_info.micro}{_suffix_}" +# Build up version_info tuple for backwards compatibility +pattern = r"(?P\d+).(?P\d+).(?P\d+)(?P.*)" +match = re.match(pattern, __version__) +assert match is not None +parts: List[object] = [int(match[part]) for part in ["major", "minor", "patch"]] +if match["rest"]: + parts.append(match["rest"]) +version_info = tuple(parts)