From 8e7f36eda3795f83b489f2bd61e33c596275171f Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Wed, 15 Mar 2023 12:30:09 -0700 Subject: [PATCH 1/3] Rename package --- .github/workflows/test.yml | 16 ++-- .gitignore | 2 +- CHANGELOG.md | 112 ++++++++++++++-------------- README.md | 48 ++++++------ RELEASE.md | 6 +- devpy/__init__.py | 9 --- example_pkg/.devpy/cmds.py | 4 +- example_pkg/.gitattributes | 2 +- example_pkg/meson.build | 2 +- example_pkg/pyproject.toml | 32 ++++---- example_pkg/{dev.py => spin} | 8 +- pyproject.toml | 10 +-- spin/__init__.py | 9 +++ {devpy => spin}/__main__.py | 16 ++-- {devpy => spin}/cmds/__init__.py | 0 {devpy => spin}/cmds/build.py | 0 {devpy => spin}/cmds/meson.py | 4 +- {devpy => spin}/cmds/util.py | 0 {devpy => spin}/color_format.py | 0 {devpy => spin}/sectioned_help.py | 0 {devpy => spin}/tests/test_meson.py | 2 +- 21 files changed, 141 insertions(+), 141 deletions(-) delete mode 100644 devpy/__init__.py rename example_pkg/{dev.py => spin} (63%) create mode 100644 spin/__init__.py rename {devpy => spin}/__main__.py (91%) rename {devpy => spin}/cmds/__init__.py (100%) rename {devpy => spin}/cmds/build.py (100%) rename {devpy => spin}/cmds/meson.py (98%) rename {devpy => spin}/cmds/util.py (100%) rename {devpy => spin}/color_format.py (100%) rename {devpy => spin}/sectioned_help.py (100%) rename {devpy => spin}/tests/test_meson.py (99%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 204c2cc..f7dc9c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ permissions: contents: read # to fetch code (actions/checkout) jobs: - test_devpy: + test_spin: strategy: matrix: python_version: ["3.7"] @@ -34,7 +34,7 @@ jobs: env: PYTHONPATH: "." run: | - pytest --pyargs devpy + pytest --pyargs spin - name: Functional tests (linux) if: matrix.os == 'ubuntu-latest' shell: 'script -q -e -c "bash --noprofile --norc -eo pipefail {0}"' @@ -42,9 +42,9 @@ jobs: TERM: xterm-256color run: | cd example_pkg - ./dev.py build - ./dev.py test - ./dev.py sdist + ./spin build + ./spin test + ./spin sdist - name: Patch Windows runner if: matrix.os == 'windows-latest' run: | @@ -56,6 +56,6 @@ jobs: if: matrix.os != 'ubuntu-latest' run: | cd example_pkg - python dev.py build - python dev.py test - python dev.py sdist + python spin build + python spin test + python spin sdist diff --git a/.gitignore b/.gitignore index 6d29862..336491f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *~ \#* -devpy.egg-info +spin.egg-info __pycache__ dist/ diff --git a/CHANGELOG.md b/CHANGELOG.md index dbb5871..dc55e76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,72 +1,72 @@ # Changelog -## [v0.1](https://github.com/scientific-python/devpy/tree/v0.1) +## [v0.1](https://github.com/scientific-python/spin/tree/v0.1) -[Full Changelog](https://github.com/scientific-python/devpy/compare/v0.1a1...v0.1) +[Full Changelog](https://github.com/scientific-python/spin/compare/v0.1a1...v0.1) **Closed issues:** -- python dev.py python no longer works [\#58](https://github.com/scientific-python/devpy/issues/58) -- Is `--reconfigure` necessary on each invocation of `meson setup`? [\#54](https://github.com/scientific-python/devpy/issues/54) -- Run build command before tests [\#50](https://github.com/scientific-python/devpy/issues/50) -- Installing devpy [\#46](https://github.com/scientific-python/devpy/issues/46) -- Additional windows problems [\#38](https://github.com/scientific-python/devpy/issues/38) -- windows builds cannot be tested [\#32](https://github.com/scientific-python/devpy/issues/32) -- Aesthetic improvements [\#21](https://github.com/scientific-python/devpy/issues/21) -- Add emoji and color to command line printing [\#20](https://github.com/scientific-python/devpy/issues/20) -- Describe history of dev.py in README [\#19](https://github.com/scientific-python/devpy/issues/19) -- Passing test arguments for a project \(e.g. numpy\) [\#13](https://github.com/scientific-python/devpy/issues/13) -- `devpy build` should install to a new directory, rather than the build dir [\#12](https://github.com/scientific-python/devpy/issues/12) -- Refactor testing [\#10](https://github.com/scientific-python/devpy/issues/10) +- python dev.py python no longer works [\#58](https://github.com/scientific-python/spin/issues/58) +- Is `--reconfigure` necessary on each invocation of `meson setup`? [\#54](https://github.com/scientific-python/spin/issues/54) +- Run build command before tests [\#50](https://github.com/scientific-python/spin/issues/50) +- Installing spin [\#46](https://github.com/scientific-python/spin/issues/46) +- Additional windows problems [\#38](https://github.com/scientific-python/spin/issues/38) +- windows builds cannot be tested [\#32](https://github.com/scientific-python/spin/issues/32) +- Aesthetic improvements [\#21](https://github.com/scientific-python/spin/issues/21) +- Add emoji and color to command line printing [\#20](https://github.com/scientific-python/spin/issues/20) +- Describe history of dev.py in README [\#19](https://github.com/scientific-python/spin/issues/19) +- Passing test arguments for a project \(e.g. numpy\) [\#13](https://github.com/scientific-python/spin/issues/13) +- `spin build` should install to a new directory, rather than the build dir [\#12](https://github.com/scientific-python/spin/issues/12) +- Refactor testing [\#10](https://github.com/scientific-python/spin/issues/10) **Merged pull requests:** -- Update pre-commit [\#60](https://github.com/scientific-python/devpy/pull/60) ([jarrodmillman](https://github.com/jarrodmillman)) -- Only configure/reconfigure as necessary [\#59](https://github.com/scientific-python/devpy/pull/59) ([stefanv](https://github.com/stefanv)) -- pytest: replace existing process [\#57](https://github.com/scientific-python/devpy/pull/57) ([stefanv](https://github.com/stefanv)) -- Add docstrings [\#56](https://github.com/scientific-python/devpy/pull/56) ([stefanv](https://github.com/stefanv)) -- Meson building is now tested on example_pkg, so can remove on devpy itself [\#55](https://github.com/scientific-python/devpy/pull/55) ([stefanv](https://github.com/stefanv)) -- Group meson commands in preparation for other build systems [\#52](https://github.com/scientific-python/devpy/pull/52) ([stefanv](https://github.com/stefanv)) -- Run `build` before `test` command [\#51](https://github.com/scientific-python/devpy/pull/51) ([stefanv](https://github.com/stefanv)) -- Add installation instructions [\#49](https://github.com/scientific-python/devpy/pull/49) ([stefanv](https://github.com/stefanv)) -- Add ability to build sdist [\#48](https://github.com/scientific-python/devpy/pull/48) ([stefanv](https://github.com/stefanv)) -- Rename build cmd to make room for other build backends [\#47](https://github.com/scientific-python/devpy/pull/47) ([stefanv](https://github.com/stefanv)) -- Fix Windows builds: use `meson compile` instead of `ninja` [\#43](https://github.com/scientific-python/devpy/pull/43) ([stefanv](https://github.com/stefanv)) -- DOC: add some hints to build, test [\#42](https://github.com/scientific-python/devpy/pull/42) ([mattip](https://github.com/mattip)) -- Remove Strawberry GCC compiler in Windows CI [\#41](https://github.com/scientific-python/devpy/pull/41) ([stefanv](https://github.com/stefanv)) -- Fix Powershell build [\#39](https://github.com/scientific-python/devpy/pull/39) ([stefanv](https://github.com/stefanv)) -- Update precommits [\#37](https://github.com/scientific-python/devpy/pull/37) ([jarrodmillman](https://github.com/jarrodmillman)) -- Prefer site-packages paths with Python version [\#35](https://github.com/scientific-python/devpy/pull/35) ([stefanv](https://github.com/stefanv)) -- Fix support for python 3.7 [\#34](https://github.com/scientific-python/devpy/pull/34) ([eli-schwartz](https://github.com/eli-schwartz)) -- Revert "Match current Python version for site-packages \(\#29\)" [\#33](https://github.com/scientific-python/devpy/pull/33) ([jarrodmillman](https://github.com/jarrodmillman)) -- Run `pytest` as `python -m pytest` [\#30](https://github.com/scientific-python/devpy/pull/30) ([stefanv](https://github.com/stefanv)) -- Match current Python version when searching for site-packages [\#29](https://github.com/scientific-python/devpy/pull/29) ([stefanv](https://github.com/stefanv)) -- Do not rely on `project` section of `pyproject.toml` [\#27](https://github.com/scientific-python/devpy/pull/27) ([stefanv](https://github.com/stefanv)) -- Refactor testing to use an example package, instead of devpy itself [\#25](https://github.com/scientific-python/devpy/pull/25) ([stefanv](https://github.com/stefanv)) -- Update README [\#24](https://github.com/scientific-python/devpy/pull/24) ([stefanv](https://github.com/stefanv)) -- Add simple color formatter [\#23](https://github.com/scientific-python/devpy/pull/23) ([stefanv](https://github.com/stefanv)) -- Add command sections [\#22](https://github.com/scientific-python/devpy/pull/22) ([stefanv](https://github.com/stefanv)) -- Install only changed files [\#18](https://github.com/scientific-python/devpy/pull/18) ([stefanv](https://github.com/stefanv)) -- Apply cwd argument of run also to execvp [\#17](https://github.com/scientific-python/devpy/pull/17) ([stefanv](https://github.com/stefanv)) -- Add --clean flag to build command [\#16](https://github.com/scientific-python/devpy/pull/16) ([stefanv](https://github.com/stefanv)) -- Better errors on missing cmds/broken module/missing module [\#15](https://github.com/scientific-python/devpy/pull/15) ([stefanv](https://github.com/stefanv)) -- Separate build dir and install dir [\#14](https://github.com/scientific-python/devpy/pull/14) ([stefanv](https://github.com/stefanv)) -- Use `meson setup` instead of `meson`. The latter is deprecated. [\#11](https://github.com/scientific-python/devpy/pull/11) ([rgommers](https://github.com/rgommers)) -- Add basic testing [\#9](https://github.com/scientific-python/devpy/pull/9) ([stefanv](https://github.com/stefanv)) -- Fix PYTHONPATH issue when invoking shell [\#8](https://github.com/scientific-python/devpy/pull/8) ([stefanv](https://github.com/stefanv)) -- Add module description [\#7](https://github.com/scientific-python/devpy/pull/7) ([stefanv](https://github.com/stefanv)) -- Add flags to control build output verbosity [\#6](https://github.com/scientific-python/devpy/pull/6) ([stefanv](https://github.com/stefanv)) -- Flush build cmd, so it gets printed before output [\#5](https://github.com/scientific-python/devpy/pull/5) ([stefanv](https://github.com/stefanv)) -- Add rationale behind devpy [\#4](https://github.com/scientific-python/devpy/pull/4) ([stefanv](https://github.com/stefanv)) -- Don't use flit [\#3](https://github.com/scientific-python/devpy/pull/3) ([jarrodmillman](https://github.com/jarrodmillman)) +- Update pre-commit [\#60](https://github.com/scientific-python/spin/pull/60) ([jarrodmillman](https://github.com/jarrodmillman)) +- Only configure/reconfigure as necessary [\#59](https://github.com/scientific-python/spin/pull/59) ([stefanv](https://github.com/stefanv)) +- pytest: replace existing process [\#57](https://github.com/scientific-python/spin/pull/57) ([stefanv](https://github.com/stefanv)) +- Add docstrings [\#56](https://github.com/scientific-python/spin/pull/56) ([stefanv](https://github.com/stefanv)) +- Meson building is now tested on example_pkg, so can remove on spin itself [\#55](https://github.com/scientific-python/spin/pull/55) ([stefanv](https://github.com/stefanv)) +- Group meson commands in preparation for other build systems [\#52](https://github.com/scientific-python/spin/pull/52) ([stefanv](https://github.com/stefanv)) +- Run `build` before `test` command [\#51](https://github.com/scientific-python/spin/pull/51) ([stefanv](https://github.com/stefanv)) +- Add installation instructions [\#49](https://github.com/scientific-python/spin/pull/49) ([stefanv](https://github.com/stefanv)) +- Add ability to build sdist [\#48](https://github.com/scientific-python/spin/pull/48) ([stefanv](https://github.com/stefanv)) +- Rename build cmd to make room for other build backends [\#47](https://github.com/scientific-python/spin/pull/47) ([stefanv](https://github.com/stefanv)) +- Fix Windows builds: use `meson compile` instead of `ninja` [\#43](https://github.com/scientific-python/spin/pull/43) ([stefanv](https://github.com/stefanv)) +- DOC: add some hints to build, test [\#42](https://github.com/scientific-python/spin/pull/42) ([mattip](https://github.com/mattip)) +- Remove Strawberry GCC compiler in Windows CI [\#41](https://github.com/scientific-python/spin/pull/41) ([stefanv](https://github.com/stefanv)) +- Fix Powershell build [\#39](https://github.com/scientific-python/spin/pull/39) ([stefanv](https://github.com/stefanv)) +- Update precommits [\#37](https://github.com/scientific-python/spin/pull/37) ([jarrodmillman](https://github.com/jarrodmillman)) +- Prefer site-packages paths with Python version [\#35](https://github.com/scientific-python/spin/pull/35) ([stefanv](https://github.com/stefanv)) +- Fix support for python 3.7 [\#34](https://github.com/scientific-python/spin/pull/34) ([eli-schwartz](https://github.com/eli-schwartz)) +- Revert "Match current Python version for site-packages \(\#29\)" [\#33](https://github.com/scientific-python/spin/pull/33) ([jarrodmillman](https://github.com/jarrodmillman)) +- Run `pytest` as `python -m pytest` [\#30](https://github.com/scientific-python/spin/pull/30) ([stefanv](https://github.com/stefanv)) +- Match current Python version when searching for site-packages [\#29](https://github.com/scientific-python/spin/pull/29) ([stefanv](https://github.com/stefanv)) +- Do not rely on `project` section of `pyproject.toml` [\#27](https://github.com/scientific-python/spin/pull/27) ([stefanv](https://github.com/stefanv)) +- Refactor testing to use an example package, instead of spin itself [\#25](https://github.com/scientific-python/spin/pull/25) ([stefanv](https://github.com/stefanv)) +- Update README [\#24](https://github.com/scientific-python/spin/pull/24) ([stefanv](https://github.com/stefanv)) +- Add simple color formatter [\#23](https://github.com/scientific-python/spin/pull/23) ([stefanv](https://github.com/stefanv)) +- Add command sections [\#22](https://github.com/scientific-python/spin/pull/22) ([stefanv](https://github.com/stefanv)) +- Install only changed files [\#18](https://github.com/scientific-python/spin/pull/18) ([stefanv](https://github.com/stefanv)) +- Apply cwd argument of run also to execvp [\#17](https://github.com/scientific-python/spin/pull/17) ([stefanv](https://github.com/stefanv)) +- Add --clean flag to build command [\#16](https://github.com/scientific-python/spin/pull/16) ([stefanv](https://github.com/stefanv)) +- Better errors on missing cmds/broken module/missing module [\#15](https://github.com/scientific-python/spin/pull/15) ([stefanv](https://github.com/stefanv)) +- Separate build dir and install dir [\#14](https://github.com/scientific-python/spin/pull/14) ([stefanv](https://github.com/stefanv)) +- Use `meson setup` instead of `meson`. The latter is deprecated. [\#11](https://github.com/scientific-python/spin/pull/11) ([rgommers](https://github.com/rgommers)) +- Add basic testing [\#9](https://github.com/scientific-python/spin/pull/9) ([stefanv](https://github.com/stefanv)) +- Fix PYTHONPATH issue when invoking shell [\#8](https://github.com/scientific-python/spin/pull/8) ([stefanv](https://github.com/stefanv)) +- Add module description [\#7](https://github.com/scientific-python/spin/pull/7) ([stefanv](https://github.com/stefanv)) +- Add flags to control build output verbosity [\#6](https://github.com/scientific-python/spin/pull/6) ([stefanv](https://github.com/stefanv)) +- Flush build cmd, so it gets printed before output [\#5](https://github.com/scientific-python/spin/pull/5) ([stefanv](https://github.com/stefanv)) +- Add rationale behind spin [\#4](https://github.com/scientific-python/spin/pull/4) ([stefanv](https://github.com/stefanv)) +- Don't use flit [\#3](https://github.com/scientific-python/spin/pull/3) ([jarrodmillman](https://github.com/jarrodmillman)) -## [v0.1a1](https://github.com/scientific-python/devpy/tree/v0.1a1) (2022-10-14) +## [v0.1a1](https://github.com/scientific-python/spin/tree/v0.1a1) (2022-10-14) -[Full Changelog](https://github.com/scientific-python/devpy/compare/v0.0...v0.1a1) +[Full Changelog](https://github.com/scientific-python/spin/compare/v0.0...v0.1a1) **Merged pull requests:** -- Document release process [\#2](https://github.com/scientific-python/devpy/pull/2) ([jarrodmillman](https://github.com/jarrodmillman)) -- Add pre-commit hooks and CI linter [\#1](https://github.com/scientific-python/devpy/pull/1) ([jarrodmillman](https://github.com/jarrodmillman)) +- Document release process [\#2](https://github.com/scientific-python/spin/pull/2) ([jarrodmillman](https://github.com/jarrodmillman)) +- Add pre-commit hooks and CI linter [\#1](https://github.com/scientific-python/spin/pull/1) ([jarrodmillman](https://github.com/jarrodmillman)) \* _This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)_ diff --git a/README.md b/README.md index aa448b6..707276c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Developers need to memorize a whole bunch of magic command-line incantations. And these incantations change from time to time! Typically, their lives are made simpler by a Makefile, but Makefiles can be convoluted, are not written in Python, and are hard to extend. -The rationale behind `devpy` is therefore to provide a simple interface for common development tasks. +The rationale behind `spin` is therefore to provide a simple interface for common development tasks. It comes with a few common build commands out the box, but can easily be customized per project. As a curiosity: the impetus behind developing the tool was the mass migration of scientific Python libraries (SciPy, scikit-image, and NumPy, etc.) to Meson, after distutils was deprecated. @@ -11,26 +11,26 @@ When many of the build and installation commands changed, it made sense to abstr ## Installation -`devpy` is not yet available via PyPi (but soon!). +`spin` is not yet available via PyPi (but soon!). Meanwhile, please install it directly from GitHub: ``` -pip install git+https://github.com/scientific-python/devpy +pip install git+https://github.com/scientific-python/spin ``` ## Configuration Settings are in your project's `pyproject.toml`. -As an example, see the `[tool.devpy]` section of [an example `pyproject.toml`](https://github.com/scientific-python/devpy/blob/main/example_pkg/pyproject.toml). +As an example, see the `[tool.spin]` section of [an example `pyproject.toml`](https://github.com/scientific-python/spin/blob/main/example_pkg/pyproject.toml). -The `[tool.devpy]` section should contain: +The `[tool.spin]` section should contain: ``` package = "pkg_importname" # name of your package commands = [ - "devpy.cmds.meson.build", - "devpy.cmds.meson.test" + "spin.cmds.meson.build", + "spin.cmds.meson.test" ] ``` @@ -42,15 +42,15 @@ Once you have several commands, it may be useful to organize them into sections. In `pyproject.toml`, instead of specifying the commands as a list, use the following structure: ```toml -[tool.devpy.commands] +[tool.spin.commands] "Build" = [ - "devpy.cmds.meson.build", - "devpy.cmds.meson.test" + "spin.cmds.meson.build", + "spin.cmds.meson.test" ] "Environments" = [ - "devpy.cmds.meson.shell", - "devpy.cmds.meson.ipython", - "devpy.cmds.meson.python" + "spin.cmds.meson.shell", + "spin.cmds.meson.ipython", + "spin.cmds.meson.python" ] ``` @@ -70,10 +70,10 @@ Environments: ## Running ``` -python -m devpy +python -m spin ``` -On Unix-like systems, you can also copy the [`dev.py` script](https://github.com/scientific-python/devpy/blob/main/example_pkg/dev.py) to the root of your project directory, and launch it as: +On Unix-like systems, you can also copy the [`dev.py` script](https://github.com/scientific-python/spin/blob/main/example_pkg/dev.py) to the root of your project directory, and launch it as: ``` ./dev.py @@ -93,7 +93,7 @@ On Unix-like systems, you can also copy the [`dev.py` script](https://github.com ### [Build](https://pypa-build.readthedocs.io/en/stable/) (PEP 517 builder) -`devpy` was started with Meson in mind, but we're working on expanding commands for PEP 517 `build`. +`spin` was started with Meson in mind, but we're working on expanding commands for PEP 517 `build`. ``` sdist 📦 Build a source distribution in `dist/`. @@ -101,17 +101,17 @@ On Unix-like systems, you can also copy the [`dev.py` script](https://github.com ## 🧪 Custom commands -`devpy` can invoke custom commands. These commands define their own arguments, and have access to the `pyproject.toml` file for further configuration. +`spin` can invoke custom commands. These commands define their own arguments, and have access to the `pyproject.toml` file for further configuration. -See, e.g., the [example custom command](https://github.com/scientific-python/devpy/blob/main/example_pkg/.devpy/cmds.py). +See, e.g., the [example custom command](https://github.com/scientific-python/spin/blob/main/example_pkg/.spin/cmds.py). -Add custom commands to the `commands` variable in the `[tool.devpy]` section of `pyproject.toml` as follows: +Add custom commands to the `commands` variable in the `[tool.spin]` section of `pyproject.toml` as follows: ``` -commands = [..., '.devpy/cmds.py:example'] +commands = [..., '.spin/cmds.py:example'] ``` -Here, the command is stored in `.devpy/cmds.py`, and the function +Here, the command is stored in `.spin/cmds.py`, and the function is named `example`. ### Configuration @@ -119,16 +119,16 @@ is named `example`. Custom commands can access the `pyproject.toml` as follows: ```python -from devpy import util +from spin import util @click.command() def example(): """Command that accesses `pyproject.toml` configuration""" config = util.get_config() - print(config["tool.devpy"]) + print(config["tool.spin"]) ``` ## History The `dev.py` tool was [proposed for SciPy](https://github.com/scipy/scipy/issues/15489) by Ralf Gommers and [implemented](https://github.com/scipy/scipy/pull/15959) by Sayantika Banik, Eduardo Naufel Schettino, and Ralf Gommers (also see [Sayantika's blog post](https://labs.quansight.org/blog/the-evolution-of-the-scipy-developer-cli)). -Inspired by that implementation, `devpy` (this package) is a minimal rewrite by Stéfan van der Walt, that aims to be easily extendable so that it can be used across ecosystem libraries. +Inspired by that implementation, `spin` (this package) is a minimal rewrite by Stéfan van der Walt, that aims to be easily extendable so that it can be used across ecosystem libraries. diff --git a/RELEASE.md b/RELEASE.md index d38f310..e953d45 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -15,7 +15,7 @@ Example `version` - Update and review `CHANGELOG.md`: gem install github_changelog_generator - github_changelog_generator -u scientific-python -p devpy --since-tag= + github_changelog_generator -u scientific-python -p spin --since-tag= - Update `version` in `pyproject.toml`. @@ -35,12 +35,12 @@ Example `version` git push --tags origin main - where `origin` is the name of the `github.com:scientific-python/devpy` + where `origin` is the name of the `github.com:scientific-python/spin` repository - Review the github release page: - https://github.com/scientific-python/devpy/releases + https://github.com/scientific-python/spin/releases - Publish on PyPi: diff --git a/devpy/__init__.py b/devpy/__init__.py deleted file mode 100644 index 92b6202..0000000 --- a/devpy/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -""" -`devpy` is a developer tool for scientific Python libraries - -For usage information see `python -m devpy`. - -Read more at https://github.com/scientific-python/devpy -""" - -from .cmds import util diff --git a/example_pkg/.devpy/cmds.py b/example_pkg/.devpy/cmds.py index 17300df..b639f1d 100644 --- a/example_pkg/.devpy/cmds.py +++ b/example_pkg/.devpy/cmds.py @@ -1,6 +1,6 @@ import json import click -from devpy import util +from spin import util @click.command() @@ -19,4 +19,4 @@ def example(flag): print(flag or None) click.secho("\nTool config is:", fg="yellow") - print(json.dumps(config["tool.devpy"], indent=2)) + print(json.dumps(config["tool.spin"], indent=2)) diff --git a/example_pkg/.gitattributes b/example_pkg/.gitattributes index 6b74722..1a13b26 100644 --- a/example_pkg/.gitattributes +++ b/example_pkg/.gitattributes @@ -1,2 +1,2 @@ .* export-ignore -.devpy -export-ignore +.spin -export-ignore diff --git a/example_pkg/meson.build b/example_pkg/meson.build index 4f3d1eb..0501504 100644 --- a/example_pkg/meson.build +++ b/example_pkg/meson.build @@ -1,5 +1,5 @@ project( - 'devpy-example-pkg', + 'spin-example-pkg', 'c', version: '0.0.dev0', license: 'BSD-3', diff --git a/example_pkg/pyproject.toml b/example_pkg/pyproject.toml index c6ec254..90acf3d 100644 --- a/example_pkg/pyproject.toml +++ b/example_pkg/pyproject.toml @@ -10,29 +10,29 @@ requires = [ "meson-python>=0.13.0rc0", ] -[tool.devpy] +[tool.spin] package = 'example_pkg' -[tool.devpy.commands] -# If you don't need sections, you can also provide a list of commands under [tool.devpy]: +[tool.spin.commands] +# If you don't need sections, you can also provide a list of commands under [tool.spin]: # # commands = [ -# "devpy.cmds.meson.build", -# "devpy.cmds.meson.test", -# "devpy.cmds.meson.shell", -# "devpy.cmds.meson.ipython", -# "devpy.cmds.meson.python", -# ".devpy/cmds.py:example" +# "spin.cmds.meson.build", +# "spin.cmds.meson.test", +# "spin.cmds.meson.shell", +# "spin.cmds.meson.ipython", +# "spin.cmds.meson.python", +# ".spin/cmds.py:example" # ] "Build" = [ - "devpy.cmds.meson.build", - "devpy.cmds.meson.test", - "devpy.cmds.build.sdist" + "spin.cmds.meson.build", + "spin.cmds.meson.test", + "spin.cmds.build.sdist" ] "Environments" = [ - "devpy.cmds.meson.shell", - "devpy.cmds.meson.ipython", - "devpy.cmds.meson.python" + "spin.cmds.meson.shell", + "spin.cmds.meson.ipython", + "spin.cmds.meson.python" ] -"Extensions" = [".devpy/cmds.py:example"] +"Extensions" = [".spin/cmds.py:example"] diff --git a/example_pkg/dev.py b/example_pkg/spin similarity index 63% rename from example_pkg/dev.py rename to example_pkg/spin index 2050149..177f430 100755 --- a/example_pkg/dev.py +++ b/example_pkg/spin @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Example stub for running `python -m dev.py` +# Example stub for running `python -m spin` # # Copy this into your project root. @@ -10,10 +10,10 @@ sys.path.remove(os.path.abspath(os.path.dirname(sys.argv[0]))) try: - runpy.run_module("devpy", run_name="__main__") + runpy.run_module("spin", run_name="__main__") except ImportError: - print("Cannot import devpy; please install it using") + print("Cannot import spin; please install it using") print() - print(" pip install git+https://github.com/scientific-python/devpy") + print(" pip install git+https://github.com/scientific-python/spin") print() sys.exit(1) diff --git a/pyproject.toml b/pyproject.toml index 68e049a..65e6867 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,11 @@ [project] -name = "devpy" -version = "0.2rc1.dev0" +name = "spin" +version = "0.2b1" requires-python = ">=3.7" description = "Developer tool for scientific Python libraries" license = {file = "LICENSE"} maintainers = [ - {name = "Scientific Python", email = "devpy@discuss.scientific-python.org"} + {name = "Scientific Python", email = "spin@discuss.scientific-python.org"} ] classifiers = [ "Development Status :: 4 - Beta", @@ -21,10 +21,10 @@ dependencies = [ lint = ["pre-commit >= 3.1"] [project.urls] -homepage = "https://github.com/scientific-python/devpy" +homepage = "https://github.com/scientific-python/spin" [tool.setuptools.packages.find] -include = ["devpy*"] +include = ["spin*"] [tool.pytest.ini_options] filterwarnings = [ diff --git a/spin/__init__.py b/spin/__init__.py new file mode 100644 index 0000000..6659d4f --- /dev/null +++ b/spin/__init__.py @@ -0,0 +1,9 @@ +""" +`spin` is a developer tool for scientific Python libraries + +For usage information see `python -m spin`. + +Read more at https://github.com/scientific-python/spin +""" + +from .cmds import util diff --git a/devpy/__main__.py b/spin/__main__.py similarity index 91% rename from devpy/__main__.py rename to spin/__main__.py index 72991fe..b17b534 100644 --- a/devpy/__main__.py +++ b/spin/__main__.py @@ -43,9 +43,9 @@ def __getitem__(self, key): project_config = toml_config.get("project", {}) try: - config = toml_config["tool"]["devpy"] + config = toml_config["tool"]["spin"] except KeyError: - print("No configuration found in [pyproject.toml] for [tool.devpy]") + print("No configuration found in [pyproject.toml] for [tool.spin]") sys.exit(1) proj_name = project_config.get("name", config["package"]) @@ -64,14 +64,14 @@ def group(ctx): config_cmds = {"Commands": config_cmds} # Backward compatibility workaround - # Originally, you could specify any of these commands as `devpy.cmd` + # Originally, you could specify any of these commands as `spin.cmd` # and we'd fetch it from util commands = { - "devpy.build": cmds.meson.build, - "devpy.test": cmds.meson.test, - "devpy.ipython": cmds.meson.ipython, - "devpy.python": cmds.meson.python, - "devpy.shell": cmds.meson.shell, + "spin.build": cmds.meson.build, + "spin.test": cmds.meson.test, + "spin.ipython": cmds.meson.ipython, + "spin.python": cmds.meson.python, + "spin.shell": cmds.meson.shell, } for section, cmds in config_cmds.items(): diff --git a/devpy/cmds/__init__.py b/spin/cmds/__init__.py similarity index 100% rename from devpy/cmds/__init__.py rename to spin/cmds/__init__.py diff --git a/devpy/cmds/build.py b/spin/cmds/build.py similarity index 100% rename from devpy/cmds/build.py rename to spin/cmds/build.py diff --git a/devpy/cmds/meson.py b/spin/cmds/meson.py similarity index 98% rename from devpy/cmds/meson.py rename to spin/cmds/meson.py index bfb301c..4298fb4 100644 --- a/devpy/cmds/meson.py +++ b/spin/cmds/meson.py @@ -165,10 +165,10 @@ def test(ctx, pytest_args): ctx.invoke(build_cmd) if not pytest_args: - pytest_args = (cfg.get("tool.devpy.package", None),) + pytest_args = (cfg.get("tool.spin.package", None),) if pytest_args == (None,): print( - "Please specify `package = packagename` under `tool.devpy` section of `pyproject.toml`" + "Please specify `package = packagename` under `tool.spin` section of `pyproject.toml`" ) sys.exit(1) diff --git a/devpy/cmds/util.py b/spin/cmds/util.py similarity index 100% rename from devpy/cmds/util.py rename to spin/cmds/util.py diff --git a/devpy/color_format.py b/spin/color_format.py similarity index 100% rename from devpy/color_format.py rename to spin/color_format.py diff --git a/devpy/sectioned_help.py b/spin/sectioned_help.py similarity index 100% rename from devpy/sectioned_help.py rename to spin/sectioned_help.py diff --git a/devpy/tests/test_meson.py b/spin/tests/test_meson.py similarity index 99% rename from devpy/tests/test_meson.py rename to spin/tests/test_meson.py index 851399a..1ae03eb 100644 --- a/devpy/tests/test_meson.py +++ b/spin/tests/test_meson.py @@ -5,7 +5,7 @@ import pytest -from devpy.cmds import meson +from spin.cmds import meson def make_paths(root, paths): From f35055834b814cc97e1bc2f6de2bdc9a60869f10 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Wed, 15 Mar 2023 13:51:18 -0700 Subject: [PATCH 2/3] Add new package title, explain why devpy is gone --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 707276c..4851ed4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ -# Developer tool for scientific Python libraries +# 💫 Scientific Python INcantations (`spin`) + +## A developer tool for scientific Python libraries + +**NOTE:** If you are looking for `devpy`, this is it! We had to rename +the package to publish it on PyPi. Developers need to memorize a whole bunch of magic command-line incantations. And these incantations change from time to time! @@ -132,3 +137,4 @@ def example(): The `dev.py` tool was [proposed for SciPy](https://github.com/scipy/scipy/issues/15489) by Ralf Gommers and [implemented](https://github.com/scipy/scipy/pull/15959) by Sayantika Banik, Eduardo Naufel Schettino, and Ralf Gommers (also see [Sayantika's blog post](https://labs.quansight.org/blog/the-evolution-of-the-scipy-developer-cli)). Inspired by that implementation, `spin` (this package) is a minimal rewrite by Stéfan van der Walt, that aims to be easily extendable so that it can be used across ecosystem libraries. +We thank Danila Bredikhin and Luca Marconato who kindly donated the `spin` name on PyPi. From 51c327f453ce9af8f86843a3b6a25713f3736623 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Wed, 15 Mar 2023 13:55:18 -0700 Subject: [PATCH 3/3] Fix version number --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 65e6867..48a33b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "spin" -version = "0.2b1" +version = "0.2rc0.dev0" requires-python = ">=3.7" description = "Developer tool for scientific Python libraries" license = {file = "LICENSE"}