diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1e59b148..d238410f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,9 +6,10 @@ on: workflow_dispatch: inputs: debug: - description: 'Set to on, to open ssh debug session.' + description: 'Open ssh debug session.' required: true - default: 'off' + default: false + type: boolean jobs: @@ -60,11 +61,11 @@ jobs: poetry run pip install colorama poetry run pip install -U "django~=${{ matrix.django-version }}" - name: Install Emacs - if: ${{ github.event.inputs.debug == 'on' }} + if: ${{ github.event.inputs.debug == 'true' }} run: | sudo apt install emacs - name: Setup tmate session - if: ${{ github.event.inputs.debug == 'on' }} + if: ${{ github.event.inputs.debug == 'true' }} uses: mxschmitt/action-tmate@v3 with: detached: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 22314f15..6733635e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,9 +6,10 @@ on: workflow_dispatch: inputs: debug: - description: 'Set to on, to open ssh debug session.' + description: 'Open ssh debug session.' required: true - default: 'off' + default: false + type: boolean schedule: - cron: '0 13 * * *' # Runs at 6 am pacific every day @@ -18,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13.0-rc.1'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13.0-rc.2'] django-version: - '3.2' # LTS April 2024 - '4.2' # LTS April 2026 @@ -37,11 +38,11 @@ jobs: django-version: '5.1' - python-version: '3.9' django-version: '5.1' - - python-version: '3.13.0-rc.1' + - python-version: '3.13.0-rc.2' django-version: '3.2' - - python-version: '3.13.0-rc.1' + - python-version: '3.13.0-rc.2' django-version: '4.2' - - python-version: '3.13.0-rc.1' + - python-version: '3.13.0-rc.2' django-version: '5.0' steps: @@ -57,7 +58,7 @@ jobs: virtualenvs-create: true virtualenvs-in-project: true - name: Install libopenblas-dev - if: matrix.python-version == '3.13.0-rc.1' + if: matrix.python-version == '3.13.0-rc.2' run: sudo apt-get install libopenblas-dev - name: Install Release Dependencies run: | @@ -66,11 +67,11 @@ jobs: poetry install poetry run pip install -U "Django~=${{ matrix.django-version }}" - name: Install Emacs - if: ${{ github.event.inputs.debug == 'on' }} + if: ${{ github.event.inputs.debug == 'true' }} run: | sudo apt install emacs - name: Setup tmate session - if: ${{ github.event.inputs.debug == 'on' }} + if: ${{ github.event.inputs.debug == 'true' }} uses: mxschmitt/action-tmate@v3 with: detached: true @@ -128,11 +129,11 @@ jobs: sudo apt-get update sudo apt-get install -y fish - name: Install Emacs - if: ${{ github.event.inputs.debug == 'on' }} + if: ${{ github.event.inputs.debug == 'true' }} run: | sudo apt install emacs - name: Setup tmate session - if: ${{ github.event.inputs.debug == 'on' }} + if: ${{ github.event.inputs.debug == 'true' }} uses: mxschmitt/action-tmate@v3 with: detached: true @@ -199,7 +200,7 @@ jobs: # brew install sbt # brew install fish - name: Install Emacs - if: ${{ github.event.inputs.debug == 'on' }} + if: ${{ github.event.inputs.debug == 'true' }} run: | brew install emacs - name: Install Poetry @@ -215,7 +216,7 @@ jobs: poetry install poetry run pip install -U "Django~=${{ matrix.django-version }}" - name: Setup tmate session - if: ${{ github.event.inputs.debug == 'on' }} + if: ${{ github.event.inputs.debug == 'true' }} uses: mxschmitt/action-tmate@v3 with: detached: true @@ -285,11 +286,11 @@ jobs: steps: - name: Install Emacs - if: ${{ github.event.inputs.debug == 'on' }} + if: ${{ github.event.inputs.debug == 'true' }} run: | sudo apt install emacs - name: Setup tmate session - if: ${{ github.event.inputs.debug == 'on' }} + if: ${{ github.event.inputs.debug == 'true' }} uses: mxschmitt/action-tmate@v3 with: detached: true diff --git a/.github/workflows/update_coc.yml b/.github/workflows/update_coc.yml new file mode 100644 index 00000000..34014695 --- /dev/null +++ b/.github/workflows/update_coc.yml @@ -0,0 +1,66 @@ +name: Update Code of Conduct + +on: + workflow_dispatch: + inputs: + debug: + description: 'Open ssh debug session.' + required: true + default: false + type: boolean + # Run every Sunday at midnight UTC (00:00) - triggered by webhook? + schedule: + - cron: '0 0 * * 0' + + +jobs: + update_code_of_conduct: + permissions: + contents: write + issues: write + pull-requests: write + + runs-on: ubuntu-latest + + steps: + - name: Install Emacs + if: ${{ github.event.inputs.debug == 'true' }} + run: | + sudo apt install emacs + - name: Setup tmate session + if: ${{ github.event.inputs.debug == 'true' }} + uses: mxschmitt/action-tmate@v3 + with: + detached: true + timeout-minutes: 60 + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Fetch CODE_OF_CONDUCT.md from django-commons + run: | + curl -o fetched_code_of_conduct.md https://raw.githubusercontent.com/django-commons/membership/main/CODE_OF_CONDUCT.md + + - name: Check if CODE_OF_CONDUCT.md has changed + id: check_changes + run: | + if cmp -s fetched_code_of_conduct.md CODE_OF_CONDUCT.md; then + echo "No changes in CODE_OF_CONDUCT.md" + echo "changed=false" >> $GITHUB_OUTPUT + else + echo "CODE_OF_CONDUCT.md has changed" + echo "changed=true" >> $GITHUB_OUTPUT + cp fetched_code_of_conduct.md CODE_OF_CONDUCT.md + fi + + # Create a pull request to merge the changes into the main branch + - name: Create Pull Request + if: steps.check_changes.outputs.changed == 'true' + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: bot-update-coc + add-paths: | + CODE_OF_CONDUCT.md + title: "🤖 Update Code of Conduct 🤖" + body: "Update the Code of Conduct with the latest version from the django-commons repository." + commit-message: "Update CODE_OF_CONDUCT.md from django-commons" diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..604ece08 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,124 @@ + +# Django Commons Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +[django-commons-coc@googlegroups.com](mailto:django-commons-coc@googlegroups.com). +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Warning + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 2. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 3. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/README.md b/README.md index f2d47fb1..acdb48ee 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ [![PyPI status](https://img.shields.io/pypi/status/django-typer.svg)](https://pypi.python.org/pypi/django-typer) [![Documentation Status](https://readthedocs.org/projects/django-typer/badge/?version=latest)](http://django-typer.readthedocs.io/?badge=latest/) [![Code Cov](https://codecov.io/gh/bckohan/django-typer/branch/main/graph/badge.svg?token=0IZOKN2DYL)](https://codecov.io/gh/bckohan/django-typer) -[![Test Status](https://github.com/bckohan/django-typer/workflows/test/badge.svg)](https://github.com/bckohan/django-typer/actions/workflows/test.yml) -[![Lint Status](https://github.com/bckohan/django-typer/workflows/lint/badge.svg)](https://github.com/bckohan/django-typer/actions/workflows/lint.yml) +[![Test Status](https://github.com/bckohan/django-typer/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/bckohan/django-typer/actions/workflows/test.yml?query=branch:main) +[![Lint Status](https://github.com/bckohan/django-typer/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/bckohan/django-typer/actions/workflows/lint.yml?query=branch:main) Use static typing to define the CLI for your [Django](https://www.djangoproject.com/) management commands with [Typer](https://typer.tiangolo.com/). Optionally use the provided [TyperCommand](https://django-typer.readthedocs.io/en/latest/reference.html#django_typer.TyperCommand) class that inherits from [BaseCommand](https://docs.djangoproject.com/en/stable/howto/custom-management-commands/#django.core.management.BaseCommand). This class maps the [Typer](https://typer.tiangolo.com/) interface onto a class based interface that Django developers will be familiar with. All of the [BaseCommand](https://docs.djangoproject.com/en/stable/howto/custom-management-commands/#django.core.management.BaseCommand) functionality is preserved, so that [TyperCommand](https://django-typer.readthedocs.io/en/latest/reference.html#django_typer.TyperCommand) can be a drop in replacement. diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index ffed1bf1..5b332cec 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -2,39 +2,39 @@ Change Log ========== -v2.2.2 (25-AUG-2024) +v2.2.2 (2024-08-25) ==================== * Implemented `Support python 3.13 `_ * Fixed `typer > 0.12.5 toggles rich help renderings off by default `_ -v2.2.1 (17-AUG-2024) +v2.2.1 (2024-08-17) ==================== * Fixed `Remove shell_complete monkey patch when upstream PR is merged. `_ -v2.2.0 (26-JUL-2024) +v2.2.0 (2024-07-26) ==================== * Implemented `ModelObjectCompleter should optionally accept a QuerySet in place of a Model class. `_ -v2.1.3 (15-JUL-2024) +v2.1.3 (2024-07-15) ==================== * Fixed `Move from django_typer to django_typer.management broke doc reference links. `_ * Implemented `Support Django 5.1 `_ -v2.1.2 (07-JUN-2024) +v2.1.2 (2024-06-07) ==================== * Fixed `Type hint kwargs to silence pylance warnings about partially unknown types `_ -v2.1.1 (06-JUN-2024) +v2.1.1 (2024-06-06) ==================== * Fixed `handle = None does not work for mypy to silence type checkers `_ -v2.1.0 (05-JUN-2024) +v2.1.0 (2024-06-05) ==================== .. warning:: @@ -55,18 +55,18 @@ v2.1.0 (05-JUN-2024) * Implemented `Move core code out of __init__.py into management/__init__.py `_ * Fixed `Typer(help="") doesnt work. `_ -v2.0.2 (03-JUN-2024) +v2.0.2 (2024-06-03) ==================== * Fixed `class help attribute should be type hinted to allow a lazy translation string. `_ -v2.0.1 (31-MAY-2024) +v2.0.1 (2024-05-31) ==================== * Fixed `Readme images are broken. `_ -v2.0.0 (31-MAY-2024) +v2.0.0 (2024-05-31) ==================== This major version release, includes an extensive internal refactor, numerous bug fixes and the @@ -91,18 +91,18 @@ addition of a plugin-based extension pattern. * Implemented `Add completer/parser for GenericIPAddressField. `_ -v1.1.2 (22-APR-2024) +v1.1.2 (2024-04-22) ==================== * Fixed `Overridden common Django arguments fail to pass through when passed through call_command `_ -v1.1.1 (11-APR-2024) +v1.1.1 (2024-04-11) ==================== * Implemented `Fix pyright type checking and add to CI `_ * Implemented `Convert CONTRIBUTING.rst to markdown `_ -v1.1.0 (03-APR-2024) +v1.1.0 (2024-04-03) ==================== * Implemented `Convert readme to markdown. `_ @@ -114,40 +114,40 @@ v1.0.9 (yanked) * Fixed `Support typer 0.12.0 `_ -v1.0.8 (26-MAR-2024) +v1.0.8 (2024-03-26) ==================== * Fixed `Support typer 0.10 and 0.11 `_ -v1.0.7 (17-MAR-2024) +v1.0.7 (2024-03-17) ==================== * Fixed `Helps throw an exception when invoked from an absolute path that is not relative to the getcwd() `_ -v1.0.6 (14-MAR-2024) +v1.0.6 (2024-03-14) ==================== * Fixed `prompt options on groups still prompt when given as named parameters on call_command `_ -v1.0.5 (14-MAR-2024) +v1.0.5 (2024-03-14) ==================== * Fixed `Options with prompt=True are prompted twice `_ -v1.0.4 (13-MAR-2024) +v1.0.4 (2024-03-13) ==================== * Fixed `Help sometimes shows full script path in Usage: when it shouldnt. `_ * Fixed `METAVAR when ModelObjectParser supplied should default to model name `_ -v1.0.3 (08-MAR-2024) +v1.0.3 (2024-03-08) ==================== * Fixed `Incomplete typing info for @command decorator `_ -v1.0.2 (05-MAR-2024) +v1.0.2 (2024-03-05) ==================== * Fixed `name property on TyperCommand is too generic and should be private. `_ @@ -159,50 +159,50 @@ v1.0.2 (05-MAR-2024) * Fixed `Missing subcommand produces stack trace without --traceback. `_ * Fixed `Allow handle() to be an initializer. `_ -v1.0.1 (29-FEB-2024) +v1.0.1 (2024-02-29) ==================== * Fixed `shell_completion broken for click < 8.1 `_ -v1.0.0 (26-FEB-2024) +v1.0.0 (2024-02-26) ==================== * Initial production/stable release. -v0.6.1b (24-FEB-2024) +v0.6.1b (2024-02-24) ===================== * Incremental beta release - this is also the second release candidate for version 1. * Peg typer version to 0.9.x -v0.6.0b (23-FEB-2024) +v0.6.0b (2024-02-23) ===================== * Incremental beta release - this is also the first release candidate for version 1. -v0.5.0b (31-JAN-2024) +v0.5.0b (2024-01-31) ===================== * Incremental Beta Release -v0.4.0b (08-JAN-2024) +v0.4.0b (2024-01-08) ===================== * Incremental Beta Release -v0.3.0b (06-JAN-2024) +v0.3.0b (2024-01-06) ===================== * Incremental Beta Release -v0.2.0b (04-JAN-2024) +v0.2.0b (2024-01-04) ===================== * Incremental Beta Release -v0.1.0b (05-DEC-2023) +v0.1.0b (2023-12-05) ===================== * Initial Release (Beta) diff --git a/pyproject.toml b/pyproject.toml index b80978dc..a691571c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,15 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules" ] + +[project.urls] +Homepage = "https://django-typer.readthedocs.io" +Documentation = "https://django-typer.readthedocs.io" +Repository = "https://github.com/bckohan/django-typer" +Issues = "https://github.com/bckohan/django-typer/issues" +Changelog = "https://django-typer.readthedocs.io/en/latest/changelog.html" +Code_of_Conduct = "https://github.com/django-commons/membership/blob/main/CODE_OF_CONDUCT.md" + packages = [ { include = "django_typer" } ]