Skip to content

Commit fce3b46

Browse files
committed
initial commit
1 parent 6e33207 commit fce3b46

File tree

5 files changed

+310
-0
lines changed

5 files changed

+310
-0
lines changed

.github/workflows/lint.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Format and Lint with Ruff and MarkdownLint
2+
on:
3+
pull_request:
4+
branches: [main]
5+
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Install Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.12"
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install ruff
24+
# Update output format to enable automatic inline annotations.
25+
- name: Run Ruff
26+
run: |
27+
ruff check --fix --output-format=github src
28+
ruff format src
29+
30+
- name: Markdown Lint base-files
31+
uses: DavidAnson/markdownlint-cli2-action@v14
32+
with:
33+
fix: true
34+
globs: |
35+
*.md
36+
.github/**/*.md
37+
continue-on-error: true
38+
- name: Markdown Lint Docs
39+
uses: DavidAnson/markdownlint-cli2-action@v14
40+
with:
41+
fix: true
42+
globs: docs/**/*.md
43+
config: docs/.markdownlint.json
44+
continue-on-error: true
45+
- name: Commit changes
46+
run: |
47+
if [ -n "$(git status --porcelain)" ]; then
48+
git config --global user.name "Ruff"
49+
git config --global user.email "[email protected]"
50+
git add -A
51+
git commit -m "Format and lint with Ruff"
52+
git push origin HEAD:${{ github.event.pull_request.head.ref }}
53+
fi
54+
55+
56+

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build distribution
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
test:
9+
uses: ./.github/workflows/test.yml
10+
deploy:
11+
needs: test
12+
name: Deploy to PyPI
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout source
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Python 3.11
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: 3.11
22+
23+
- name: Install build dependencies
24+
run: python -m pip install build twine
25+
26+
- name: Build distributions
27+
run: python -m build
28+
29+
- name: Publish package to PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
user: __token__
33+
password: ${{ secrets.TWINE_PASSWORD}}

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: PyTest
2+
on:
3+
workflow_call:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
paths:
10+
- 'src/**'
11+
12+
jobs:
13+
test-against-matrix:
14+
# Only test all the supported versions when a pull request is made or the workflow is called
15+
if: ${{github.event_name == 'workflow_call'}} || ${{github.event_name == 'pull_request'}}
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ['3.10', '3.11']
20+
fail-fast: true
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install requirements
27+
run: |
28+
python -m pip install -e .[dev]
29+
- name: Run tests
30+
run: |
31+
python -m pytest
32+
33+
test-against-latest:
34+
# Always run against the latest version
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: actions/setup-python@v4
39+
with:
40+
python-version: '3.12'
41+
- name: Install requirements
42+
run: |
43+
python -m pip install -e .[dev]
44+
- name: Run tests
45+
run: |
46+
python -m pytest

CODE_OF_CONDUCT.md

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

pyproject.toml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[build-system]
2+
requires = ["setuptools", "setuptools_scm", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "render_engine_parsers"
7+
dynamic = ["version"]
8+
description = "Parser System for Render Engine"
9+
readme = "README.md"
10+
requires-python = ">=3.10"
11+
dependencies = [
12+
"python-frontmatter",
13+
]
14+
15+
[project.optional-dependencies]
16+
dev = [
17+
"pytest",
18+
"pytest-cov",
19+
"ruff",
20+
]
21+
22+
23+
[tool.setuptools_scm]
24+
local_scheme = "no-local-version"
25+
# version_scheme = "python-simplified-semver"
26+
27+
[project.urls]
28+
homepage = "https://github.com/kjaymiller/render_engine/"
29+
repository = "https://github.com/kjaymiller/render_engine/"
30+
documentation = "https://render-engine.readthedocs.io/en/latest/"
31+
32+
[tool.pytest.ini_options]
33+
addopts = "-ra -q --cov"
34+
35+
[tool.semantic_release]
36+
version_toml = "pyproject.toml:project.version"
37+
branch = "main"
38+
39+
[tool.ruff]
40+
select = ["E", "F", "I", "UP"]
41+
target-version = "py311"
42+
line-length = 120
43+
src = ["src"]
44+
ignore-init-module-imports = true

0 commit comments

Comments
 (0)