Skip to content

Commit 7c9032b

Browse files
build: scaffold project structure and tooling configuration
Set up the packaging and developer tooling for fastapi-dynamic-form, mirroring the layout of the dj-dynamic-form Django package: - pyproject.toml with poetry-core backend, PEP 621 metadata and black/isort/pylint/mypy/bandit/pytest/commitizen configuration - tox matrix across Python 3.9-3.13 and FastAPI 0.110/0.115 - pre-commit hooks, GitHub Actions CI and dependabot config - requirements files, LICENSE, SECURITY, AUTHORS and CHANGELOG
1 parent f7bd264 commit 7c9032b

12 files changed

Lines changed: 637 additions & 0 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "pip"
9+
directory: "/packages" # Location of the requirements.txt and requirements-dev.txt file
10+
schedule:
11+
interval: "weekly"
12+
13+
target-branch: "main"

‎.github/workflows/ci.yml‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
name: Python ${{ matrix.python-version }}
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
python-version:
13+
- '3.9'
14+
- '3.10'
15+
- '3.11'
16+
- '3.12'
17+
- '3.13'
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install coverage codecov pytest tox pre-commit
31+
pip install -r packages/requirements-dev.txt
32+
33+
- name: Run tests with coverage
34+
run: pytest --cov=dynamic_form --cov-report=xml
35+
36+
- name: Run Tox tests
37+
run: tox
38+
39+
- name: Run pre-commit hooks
40+
run: pre-commit run --all-files
41+
42+
- name: Upload coverage to Codecov
43+
run: codecov
44+
env:
45+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

‎.gitignore‎

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# Installer logs
29+
pip-log.txt
30+
pip-delete-this-directory.txt
31+
32+
# Unit test / coverage reports
33+
htmlcov/
34+
.tox/
35+
.coverage
36+
.coverage.*
37+
.cache
38+
coverage.xml
39+
*.cover
40+
.hypothesis/
41+
.pytest_cache/
42+
coverage_html_report/
43+
44+
# Environments
45+
.env
46+
.venv
47+
env/
48+
venv/
49+
ENV/
50+
env.bak/
51+
venv.bak/
52+
53+
# Editors
54+
.idea/
55+
.vscode/
56+
.spyderproject
57+
.spyproject
58+
.ropeproject
59+
60+
# Type checkers / linters
61+
.mypy_cache/
62+
.ruff_cache/
63+
bandit_report.txt
64+
65+
# Databases
66+
*.sqlite3
67+
*.db
68+
69+
# Logs
70+
*.log
71+
72+
# pyenv
73+
.python-version
74+
75+
# Sphinx documentation
76+
docs/_build/

‎.pre-commit-config.yaml‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-toml
6+
- id: check-yaml
7+
files: \.yaml$
8+
- id: trailing-whitespace
9+
exclude: (tests/|docs/).*
10+
- id: end-of-file-fixer
11+
exclude: (tests/|docs/).*
12+
- id: check-added-large-files
13+
exclude: (tests/|docs/).*
14+
- id: check-case-conflict
15+
exclude: (tests/|docs/).*
16+
- id: check-merge-conflict
17+
exclude: (tests/|docs/).*
18+
- id: check-docstring-first
19+
exclude: (tests/|docs/).*
20+
21+
- repo: https://github.com/tox-dev/pyproject-fmt
22+
rev: v2.5.1
23+
hooks:
24+
- id: pyproject-fmt
25+
26+
- repo: https://github.com/tox-dev/tox-ini-fmt
27+
rev: 1.5.0
28+
hooks:
29+
- id: tox-ini-fmt
30+
31+
- repo: https://github.com/asottile/pyupgrade
32+
rev: v3.19.1
33+
hooks:
34+
- id: pyupgrade
35+
36+
- repo: https://github.com/pre-commit/mirrors-isort
37+
rev: v5.10.1
38+
hooks:
39+
- id: isort
40+
exclude: (tests/|docs/).*
41+
42+
- repo: https://github.com/psf/black
43+
rev: 25.1.0
44+
hooks:
45+
- id: black
46+
args: [ "--config=pyproject.toml" ]
47+
exclude: (tests/|docs/).*
48+
49+
- repo: https://github.com/commitizen-tools/commitizen
50+
rev: v4.6.0
51+
hooks:
52+
- id: commitizen
53+
exclude: (tests/|docs/).*
54+
55+
- repo: https://github.com/PyCQA/bandit
56+
rev: 1.8.3
57+
hooks:
58+
- id: bandit
59+
args: [ "-c", "pyproject.toml", "-r", "." ]
60+
additional_dependencies: [ "bandit[toml]" ]
61+
exclude: (tests/|docs/).*
62+
63+
- repo: https://github.com/PyCQA/docformatter
64+
rev: v1.7.5
65+
hooks:
66+
- id: docformatter

‎AUTHORS.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Authors
2+
3+
- **Aryan Niknezhad**
4+
- GitHub: [ARYAN-NIKNEZHAD](https://github.com/ARYAN-NIKNEZHAD)
5+
- Email: aryan513966@gmail.com

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# CHANGELOG
2+
3+
<!-- version list -->
4+
5+
## v1.0.0
6+
7+
- Initial release of `fastapi-dynamic-form`.

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Lazarus
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎SECURITY.md‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
We actively support the following versions of `fastapi-dynamic-form` with security updates:
6+
7+
| Version | Supported |
8+
| --------- | ------------------ |
9+
| 1.x | ✅ Fully supported |
10+
11+
## Reporting a Vulnerability
12+
13+
We take security issues seriously. If you find a vulnerability in `fastapi-dynamic-form`, please report it confidentially. Here are the steps to report security vulnerabilities:
14+
15+
1. **Email**: Please send an email to [aryan513966@gmail.com](mailto:aryan513966@gmail.com) with a detailed description of the vulnerability.
16+
2. **Details**: In your email, include the following details:
17+
- Description of the vulnerability.
18+
- Potential impact and severity.
19+
- Steps to reproduce the issue.
20+
- Any other relevant information, such as proof of concept or screenshots.
21+
22+
We will:
23+
- Acknowledge your report within 2 business days.
24+
- Work with you to understand and resolve the issue as quickly as possible.
25+
- Provide an estimate of when a patch will be available and credit you (if desired) in the changelog.
26+
27+
## Handling Vulnerabilities
28+
29+
When a vulnerability is confirmed:
30+
- We will create a fix and apply it to all actively supported versions of `fastapi-dynamic-form`.
31+
- A new release with the security fix will be published, and the vulnerability will be disclosed in the changelog or via a security advisory.
32+
- We may delay the disclosure of details about the vulnerability until a sufficient number of users have updated to the patched version.
33+
34+
## General Security Guidelines
35+
36+
- Keep your `fastapi-dynamic-form` package up to date with the latest versions to ensure you benefit from the latest security fixes.
37+
- Follow our changelog for announcements regarding security fixes.
38+
- Ensure that your configuration is secure and does not expose sensitive information.
39+
40+
## Responsible Disclosure
41+
42+
We strongly encourage responsible disclosure and will work to fix issues in a timely manner. We appreciate any effort to help make `fastapi-dynamic-form` more secure for all users.
43+
44+
Thank you for helping us improve the security of `fastapi-dynamic-form`!

‎packages/requirements-dev.txt‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
fastapi>=0.110
2+
pydantic>=2.7
3+
pydantic-settings>=2.3
4+
sqlalchemy[asyncio]>=2.0
5+
6+
aiosqlite>=0.20.0
7+
httpx>=0.27.0
8+
pytest>=8.3.2
9+
pytest-asyncio>=0.24.0
10+
pytest-cov>=5.0.0
11+
bandit[toml]>=1.7.9
12+
black>=24.4.2
13+
commitizen>=3.28.0
14+
docformatter>=1.7.5
15+
isort>=5.13.2
16+
mypy>=1.11.1
17+
pre-commit>=3.5.0
18+
pylint>=3.2.6
19+
tox>=4.16.0

‎packages/requirements.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fastapi>=0.110
2+
pydantic>=2.7
3+
pydantic-settings>=2.3
4+
sqlalchemy[asyncio]>=2.0

0 commit comments

Comments
 (0)