Skip to content

Commit 4fdd5cf

Browse files
authored
Merge pull request #3 from github/open-source-prep
Prep to Open Source
2 parents 268e213 + 6209b3a commit 4fdd5cf

34 files changed

+1153
-437
lines changed

.github/workflows/build-and-upload.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,3 @@ jobs:
3838
- name: Build Package
3939
uses: ./ # Action defined in action.yaml in the root
4040
if: steps.changed-files.outputs.any_changed == 'true'
41-
42-
- name: Setup Octofactory config
43-
uses: jfrog/setup-jfrog-cli@7c95feb32008765e1b4e626b078dfd897c4340ad
44-
if: steps.changed-files.outputs.any_changed == 'true'
45-
env:
46-
JF_ENV_1: ${{ secrets.OCTOFACTORY_SERVER_CONFIG }}
47-
48-
- name: Upload to Octofactory
49-
if: steps.changed-files.outputs.any_changed == 'true'
50-
run: |
51-
jfrog rt u dist/ logger-decorator-pypi

.github/workflows/coverage.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
name: Post Coverage Commit
3+
4+
on:
5+
workflow_run:
6+
workflows: ["Pytest"]
7+
types:
8+
- completed
9+
10+
jobs:
11+
coverage:
12+
runs-on: ubuntu-latest
13+
if: github.event.workflow_run.event == "pull_request" && github.event.workflow_run.conclusion == "success"
14+
permissions:
15+
pull-requests: write
16+
contents: write
17+
actions: read
18+
steps:
19+
- name: Python Coverage Comment
20+
uses: py-cov-action/python-coverage-comment-action@b2eb38dd175bf053189b35f738f9207278b00925
21+
with:
22+
GITHUB_TOKEN: ${{ github.token }}
23+
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "ruff",
5+
"pattern": [
6+
{
7+
"regexp": "^(Would reformat): (.+)$",
8+
"message": 1,
9+
"file": 2
10+
}
11+
]
12+
}
13+
]
14+
}

.github/workflows/mutation.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/package-quality-control.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
jobs:
1212
# Checks that version number has been updated
1313
package-quality-control:
14+
permissions:
15+
contents: read
1416
runs-on: ubuntu-latest
1517
steps:
1618
- name: Checkout Current PR Branch
@@ -19,7 +21,7 @@ jobs:
1921
uses: actions/setup-python@v5
2022
- name: Check for Changed Files
2123
id: changed-files
22-
uses: tj-actions/changed-files@v44
24+
uses: tj-actions/changed-files@635f118699dd888d737c15018cd30aff2e0274f8
2325
with:
2426
files: |
2527
pyproject.toml

.github/workflows/pyright.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55

66
jobs:
77
pyright:
8+
permissions:
9+
contents: read
810

911
runs-on: ubuntu-latest
1012
steps:
@@ -19,4 +21,4 @@ jobs:
1921
hatch env create dev
2022
- run: echo "$(hatch env find dev)/bin" >> $GITHUB_PATH
2123
- name: Run pyright
22-
uses: jakebailey/pyright-action@v2.3.1
24+
uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe

.github/workflows/pytest.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@ on:
88

99
jobs:
1010
pytest:
11+
permissions:
12+
contents: read
1113

1214
runs-on: ${{ matrix.os }}
1315
strategy:
1416
matrix:
1517
os: [ubuntu-latest, macos-latest, windows-latest]
16-
python-version: ["3.9", "3.10", "3.11", "pypy3.9", "pypy3.10"]
17-
exclude:
18-
- os: macos-latest
19-
python-version: "3.9"
20-
- os: windows-latest
21-
python-version: "3.9"
18+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2219

2320
steps:
2421
- uses: actions/checkout@v4
@@ -35,7 +32,6 @@ jobs:
3532
# Need relative files for the action to report, but it messes up mutmut
3633
echo "[run]" >> .coveragerc
3734
echo "relative_files = true" >> .coveragerc
38-
cat .coveragerc
3935
4036
hatch run dev:pytest
4137
env:
@@ -45,27 +41,36 @@ jobs:
4541
with:
4642
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
4743
path: .coverage.${{ matrix.os }}.${{ matrix.python-version }}
44+
include-hidden-files: true
4845

4946
coverage:
47+
name: Coverage
5048
runs-on: ubuntu-latest
5149
needs: pytest
5250
permissions:
5351
pull-requests: write
5452
contents: write
5553
steps:
5654
- uses: actions/checkout@v4
57-
5855
- uses: actions/download-artifact@v4
5956
id: download
6057
with:
6158
pattern: coverage-*
6259
merge-multiple: true
6360
- name: Re-add relative so the action is happy
6461
run: |
62+
# Need relative files for the action to report, but it messes up mutmut
6563
echo "[run]" >> .coveragerc
6664
echo "relative_files = true" >> .coveragerc
6765
- name: Python Coverage Comment
68-
uses: py-cov-action/python-coverage-comment-action@v3.24
66+
uses: py-cov-action/python-coverage-comment-action@b2eb38dd175bf053189b35f738f9207278b00925
6967
with:
7068
GITHUB_TOKEN: ${{ github.token }}
7169
MERGE_COVERAGE_FILES: true
70+
- name: Store Pull Request comment to be posted
71+
uses: actions/upload-artifact@v4
72+
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
73+
with:
74+
name: python-coverage-comment-action
75+
path: python-coverage-comment-action.txt
76+
include-hidden-files: true

.github/workflows/ruff.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55

66
jobs:
77
ruff:
8+
permissions:
9+
contents: read
810

911
runs-on: ubuntu-latest
1012
steps:
@@ -17,6 +19,11 @@ jobs:
1719
run: |
1820
python -m pip install hatch
1921
hatch env create dev
20-
- name: Lint with Ruff
22+
- name: Lint with Ruff (check)
2123
run: |
22-
hatch run dev:ruff --output-format=github .
24+
hatch run dev:ruff check --output-format=github .
25+
- name: Register problem matcher for ruff format
26+
run: echo "::add-matcher::.github/workflows/matchers/ruff.json"
27+
- name: Lint with Ruff (format)
28+
run: |
29+
hatch run dev:ruff format --check .

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
# Run the formatter.
99
- id: ruff-format
1010
- repo: https://github.com/RobertCraigie/pyright-python
11-
rev: v1.1.355
11+
rev: v1.1.382
1212
hooks:
1313
- id: pyright
1414
# I don't love having to specify these here, but pre-commit only seems to work

CODE_OF_CONDUCT.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at <opensource@github.com>. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at [http://contributor-covenant.org/version/1/4][version]
72+
73+
[homepage]: http://contributor-covenant.org
74+
[version]: http://contributor-covenant.org/version/1/4/

0 commit comments

Comments
 (0)