diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..8bb9d44 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,35 @@ +name: Publish Python Package + +on: + push: + tags: + - 'v*.*.*' # Matches version tags like v1.0.0, v2.1.3, etc. + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Check out the repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.8' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build setuptools-scm + + - name: Build the package + run: python -m build + + - name: Publish to PyPI + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + pip install twine + twine upload dist/* diff --git a/README.md b/README.md index c7631af..f0d5621 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![License: GPLv3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) +[![PyPI version](https://badge.fury.io/py/dir-wand.svg)](https://badge.fury.io/py/dir-wand) WAND is a Python CLI tool for creating a large number of directories from a single template and executing commands globally throughout every directory. @@ -12,7 +13,7 @@ WAND is a Python CLI tool for creating a large number of directories from a sing To install WAND simply run ``` sh -pip install . +pip install dir-wand ``` in the root directory of WAND. This will install the `dir-wand` CLI. @@ -64,8 +65,9 @@ dir-wand --template simple_example_{num}/ --root /where/to/put/copies/ --num 0-2 Here we've passed the filepath to the template directory (which can be an absolute or relative path), an optional root for the copies (if not given the copies will be made in the current working directory) and a set of key-value pairs for each placeholder (of the form --key value). These values can be: -- The definition of an inclusive range using 2 dashes (e.g. `--num 0-2` will replace `num` values of 0, 1, and 2). +- The definition of an inclusive range using 2 dashes (e.g. `--num 0-2` will replace `num` with values of 0, 1, and 2). - A list of values using 1 dash (e.g. `-flag 0 1 0` will replace `flag` with 0, 1, and 0). +- The path to a file containing a list of strings (Coming soon...). NOTE: The number of values for each placeholder must be the same. If not, WAND will raise an error. diff --git a/pyproject.toml b/pyproject.toml index 9dc3707..def7c66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,18 +4,41 @@ name = "dir-wand" # Dynamic version numbers from git dynamic = ["version"] -description = "A CLI tool that automates the creation of directory structures from templates and populates placeholder variables." - +description = "A CLI tool for making many directories from a template automagically." authors = [ { name = "Will Roper", email = "w.roper@sussex.ac.uk" } ] +readme = "README.md" +license = { file = "LICENSE" } # Minimum Python version requires-python = ">=3.8" -license = { text = "GNU" } +# No dependencies to run dependencies = [] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: End Users/Desktop", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License (GPL)", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", + "Topic :: Software Development :: Build Tools", + "Topic :: Utilities" +] + +[project.urls] +"Homepage" = "https://github.com/WillJRoper/dir-wand" +"Source" = "https://github.com/WillJRoper/dir-wand" +"Tracker" = "https://github.com/WillJRoper/dir-wand/issues" + # Optional dependencies for specific use cases [project.optional-dependencies] # Development