Skip to content

Commit f45fd57

Browse files
authored
Merge pull request #120 from bckohan/v2.x.x
Add django-commons CoC
2 parents bd799c6 + 5bda623 commit f45fd57

File tree

7 files changed

+251
-50
lines changed

7 files changed

+251
-50
lines changed

.github/workflows/lint.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
workflow_dispatch:
77
inputs:
88
debug:
9-
description: 'Set to on, to open ssh debug session.'
9+
description: 'Open ssh debug session.'
1010
required: true
11-
default: 'off'
11+
default: false
12+
type: boolean
1213

1314
jobs:
1415

@@ -60,11 +61,11 @@ jobs:
6061
poetry run pip install colorama
6162
poetry run pip install -U "django~=${{ matrix.django-version }}"
6263
- name: Install Emacs
63-
if: ${{ github.event.inputs.debug == 'on' }}
64+
if: ${{ github.event.inputs.debug == 'true' }}
6465
run: |
6566
sudo apt install emacs
6667
- name: Setup tmate session
67-
if: ${{ github.event.inputs.debug == 'on' }}
68+
if: ${{ github.event.inputs.debug == 'true' }}
6869
uses: mxschmitt/action-tmate@v3
6970
with:
7071
detached: true

.github/workflows/test.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
workflow_dispatch:
77
inputs:
88
debug:
9-
description: 'Set to on, to open ssh debug session.'
9+
description: 'Open ssh debug session.'
1010
required: true
11-
default: 'off'
11+
default: false
12+
type: boolean
1213
schedule:
1314
- cron: '0 13 * * *' # Runs at 6 am pacific every day
1415

@@ -18,7 +19,7 @@ jobs:
1819
runs-on: ubuntu-latest
1920
strategy:
2021
matrix:
21-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13.0-rc.1']
22+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13.0-rc.2']
2223
django-version:
2324
- '3.2' # LTS April 2024
2425
- '4.2' # LTS April 2026
@@ -37,11 +38,11 @@ jobs:
3738
django-version: '5.1'
3839
- python-version: '3.9'
3940
django-version: '5.1'
40-
- python-version: '3.13.0-rc.1'
41+
- python-version: '3.13.0-rc.2'
4142
django-version: '3.2'
42-
- python-version: '3.13.0-rc.1'
43+
- python-version: '3.13.0-rc.2'
4344
django-version: '4.2'
44-
- python-version: '3.13.0-rc.1'
45+
- python-version: '3.13.0-rc.2'
4546
django-version: '5.0'
4647

4748
steps:
@@ -57,7 +58,7 @@ jobs:
5758
virtualenvs-create: true
5859
virtualenvs-in-project: true
5960
- name: Install libopenblas-dev
60-
if: matrix.python-version == '3.13.0-rc.1'
61+
if: matrix.python-version == '3.13.0-rc.2'
6162
run: sudo apt-get install libopenblas-dev
6263
- name: Install Release Dependencies
6364
run: |
@@ -66,11 +67,11 @@ jobs:
6667
poetry install
6768
poetry run pip install -U "Django~=${{ matrix.django-version }}"
6869
- name: Install Emacs
69-
if: ${{ github.event.inputs.debug == 'on' }}
70+
if: ${{ github.event.inputs.debug == 'true' }}
7071
run: |
7172
sudo apt install emacs
7273
- name: Setup tmate session
73-
if: ${{ github.event.inputs.debug == 'on' }}
74+
if: ${{ github.event.inputs.debug == 'true' }}
7475
uses: mxschmitt/action-tmate@v3
7576
with:
7677
detached: true
@@ -128,11 +129,11 @@ jobs:
128129
sudo apt-get update
129130
sudo apt-get install -y fish
130131
- name: Install Emacs
131-
if: ${{ github.event.inputs.debug == 'on' }}
132+
if: ${{ github.event.inputs.debug == 'true' }}
132133
run: |
133134
sudo apt install emacs
134135
- name: Setup tmate session
135-
if: ${{ github.event.inputs.debug == 'on' }}
136+
if: ${{ github.event.inputs.debug == 'true' }}
136137
uses: mxschmitt/action-tmate@v3
137138
with:
138139
detached: true
@@ -199,7 +200,7 @@ jobs:
199200
# brew install sbt
200201
# brew install fish
201202
- name: Install Emacs
202-
if: ${{ github.event.inputs.debug == 'on' }}
203+
if: ${{ github.event.inputs.debug == 'true' }}
203204
run: |
204205
brew install emacs
205206
- name: Install Poetry
@@ -215,7 +216,7 @@ jobs:
215216
poetry install
216217
poetry run pip install -U "Django~=${{ matrix.django-version }}"
217218
- name: Setup tmate session
218-
if: ${{ github.event.inputs.debug == 'on' }}
219+
if: ${{ github.event.inputs.debug == 'true' }}
219220
uses: mxschmitt/action-tmate@v3
220221
with:
221222
detached: true
@@ -285,11 +286,11 @@ jobs:
285286

286287
steps:
287288
- name: Install Emacs
288-
if: ${{ github.event.inputs.debug == 'on' }}
289+
if: ${{ github.event.inputs.debug == 'true' }}
289290
run: |
290291
sudo apt install emacs
291292
- name: Setup tmate session
292-
if: ${{ github.event.inputs.debug == 'on' }}
293+
if: ${{ github.event.inputs.debug == 'true' }}
293294
uses: mxschmitt/action-tmate@v3
294295
with:
295296
detached: true

.github/workflows/update_coc.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Update Code of Conduct
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
debug:
7+
description: 'Open ssh debug session.'
8+
required: true
9+
default: false
10+
type: boolean
11+
# Run every Sunday at midnight UTC (00:00) - triggered by webhook?
12+
schedule:
13+
- cron: '0 0 * * 0'
14+
15+
16+
jobs:
17+
update_code_of_conduct:
18+
permissions:
19+
contents: write
20+
issues: write
21+
pull-requests: write
22+
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Install Emacs
27+
if: ${{ github.event.inputs.debug == 'true' }}
28+
run: |
29+
sudo apt install emacs
30+
- name: Setup tmate session
31+
if: ${{ github.event.inputs.debug == 'true' }}
32+
uses: mxschmitt/action-tmate@v3
33+
with:
34+
detached: true
35+
timeout-minutes: 60
36+
- name: Checkout repository
37+
uses: actions/checkout@v4
38+
39+
- name: Fetch CODE_OF_CONDUCT.md from django-commons
40+
run: |
41+
curl -o fetched_code_of_conduct.md https://raw.githubusercontent.com/django-commons/membership/main/CODE_OF_CONDUCT.md
42+
43+
- name: Check if CODE_OF_CONDUCT.md has changed
44+
id: check_changes
45+
run: |
46+
if cmp -s fetched_code_of_conduct.md CODE_OF_CONDUCT.md; then
47+
echo "No changes in CODE_OF_CONDUCT.md"
48+
echo "changed=false" >> $GITHUB_OUTPUT
49+
else
50+
echo "CODE_OF_CONDUCT.md has changed"
51+
echo "changed=true" >> $GITHUB_OUTPUT
52+
cp fetched_code_of_conduct.md CODE_OF_CONDUCT.md
53+
fi
54+
55+
# Create a pull request to merge the changes into the main branch
56+
- name: Create Pull Request
57+
if: steps.check_changes.outputs.changed == 'true'
58+
uses: peter-evans/create-pull-request@v7
59+
with:
60+
token: ${{ secrets.GITHUB_TOKEN }}
61+
branch: bot-update-coc
62+
add-paths: |
63+
CODE_OF_CONDUCT.md
64+
title: "🤖 Update Code of Conduct 🤖"
65+
body: "Update the Code of Conduct with the latest version from the django-commons repository."
66+
commit-message: "Update CODE_OF_CONDUCT.md from django-commons"

CODE_OF_CONDUCT.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
2+
# Django Commons Code of Conduct
3+
4+
## Our Pledge
5+
6+
We as members, contributors, and leaders pledge to make participation in our
7+
community a harassment-free experience for everyone, regardless of age, body
8+
size, visible or invisible disability, ethnicity, sex characteristics, gender
9+
identity and expression, level of experience, education, socio-economic status,
10+
nationality, personal appearance, race, caste, color, religion, or sexual
11+
identity and orientation.
12+
13+
We pledge to act and interact in ways that contribute to an open, welcoming,
14+
diverse, inclusive, and healthy community.
15+
16+
## Our Standards
17+
18+
Examples of behavior that contributes to a positive environment for our
19+
community include:
20+
21+
* Demonstrating empathy and kindness toward other people
22+
* Being respectful of differing opinions, viewpoints, and experiences
23+
* Giving and gracefully accepting constructive feedback
24+
* Accepting responsibility and apologizing to those affected by our mistakes,
25+
and learning from the experience
26+
* Focusing on what is best not just for us as individuals, but for the overall
27+
community
28+
29+
Examples of unacceptable behavior include:
30+
31+
* The use of sexualized language or imagery, and sexual attention or advances of
32+
any kind
33+
* Trolling, insulting or derogatory comments, and personal or political attacks
34+
* Public or private harassment
35+
* Publishing others' private information, such as a physical or email address,
36+
without their explicit permission
37+
* Other conduct which could reasonably be considered inappropriate in a
38+
professional setting
39+
40+
## Enforcement Responsibilities
41+
42+
Community leaders are responsible for clarifying and enforcing our standards of
43+
acceptable behavior and will take appropriate and fair corrective action in
44+
response to any behavior that they deem inappropriate, threatening, offensive,
45+
or harmful.
46+
47+
Community leaders have the right and responsibility to remove, edit, or reject
48+
comments, commits, code, wiki edits, issues, and other contributions that are
49+
not aligned to this Code of Conduct, and will communicate reasons for moderation
50+
decisions when appropriate.
51+
52+
## Scope
53+
54+
This Code of Conduct applies within all community spaces, and also applies when
55+
an individual is officially representing the community in public spaces.
56+
Examples of representing our community include using an official email address,
57+
posting via an official social media account, or acting as an appointed
58+
representative at an online or offline event.
59+
60+
## Enforcement
61+
62+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
63+
reported to the community leaders responsible for enforcement at
64+
65+
All complaints will be reviewed and investigated promptly and fairly.
66+
67+
All community leaders are obligated to respect the privacy and security of the
68+
reporter of any incident.
69+
70+
## Enforcement Guidelines
71+
72+
Community leaders will follow these Community Impact Guidelines in determining
73+
the consequences for any action they deem in violation of this Code of Conduct:
74+
75+
### 1. Warning
76+
77+
**Community Impact**: Use of inappropriate language or other behavior deemed
78+
unprofessional or unwelcome in the community.
79+
80+
**Consequence**: A warning with consequences for continued behavior. No
81+
interaction with the people involved, including unsolicited interaction with
82+
those enforcing the Code of Conduct, for a specified period of time. This
83+
includes avoiding interactions in community spaces as well as external channels
84+
like social media. Violating these terms may lead to a temporary or permanent
85+
ban.
86+
87+
### 2. Temporary Ban
88+
89+
**Community Impact**: A serious violation of community standards, including
90+
sustained inappropriate behavior.
91+
92+
**Consequence**: A temporary ban from any sort of interaction or public
93+
communication with the community for a specified period of time. No public or
94+
private interaction with the people involved, including unsolicited interaction
95+
with those enforcing the Code of Conduct, is allowed during this period.
96+
Violating these terms may lead to a permanent ban.
97+
98+
### 3. Permanent Ban
99+
100+
**Community Impact**: Demonstrating a pattern of violation of community
101+
standards, including sustained inappropriate behavior, harassment of an
102+
individual, or aggression toward or disparagement of classes of individuals.
103+
104+
**Consequence**: A permanent ban from any sort of public interaction within the
105+
community.
106+
107+
## Attribution
108+
109+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
110+
version 2.1, available at
111+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
112+
113+
Community Impact Guidelines were inspired by
114+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
115+
116+
For answers to common questions about this code of conduct, see the FAQ at
117+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
118+
[https://www.contributor-covenant.org/translations][translations].
119+
120+
[homepage]: https://www.contributor-covenant.org
121+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
122+
[Mozilla CoC]: https://github.com/mozilla/diversity
123+
[FAQ]: https://www.contributor-covenant.org/faq
124+
[translations]: https://www.contributor-covenant.org/translations

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
[![PyPI status](https://img.shields.io/pypi/status/django-typer.svg)](https://pypi.python.org/pypi/django-typer)
1010
[![Documentation Status](https://readthedocs.org/projects/django-typer/badge/?version=latest)](http://django-typer.readthedocs.io/?badge=latest/)
1111
[![Code Cov](https://codecov.io/gh/bckohan/django-typer/branch/main/graph/badge.svg?token=0IZOKN2DYL)](https://codecov.io/gh/bckohan/django-typer)
12-
[![Test Status](https://github.com/bckohan/django-typer/workflows/test/badge.svg)](https://github.com/bckohan/django-typer/actions/workflows/test.yml)
13-
[![Lint Status](https://github.com/bckohan/django-typer/workflows/lint/badge.svg)](https://github.com/bckohan/django-typer/actions/workflows/lint.yml)
12+
[![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)
13+
[![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)
1414

1515
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.
1616

0 commit comments

Comments
 (0)