Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Generate JSON schemas from Python data models [TECHART-244] #8

Draft
wants to merge 66 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
cd8e13f
feat: python project scaffold
Jun 24, 2023
5d519e2
feat: add python, linux, macOS files to gitignore
Jun 24, 2023
117fd52
feat(codestyle): normalize strings
Jun 25, 2023
77c4d39
feat(codestyle): add mypy settings
Jun 25, 2023
a96c145
feat(schema): add python BaseModel
Jun 25, 2023
d063bc8
feat(schema): mesh triangle count model
Jun 25, 2023
3df56ae
fix(schema): remove default values from properties
Jul 10, 2023
ac2c8dd
fix(schema): raise outfitBottom tri-count to 6000
Jul 10, 2023
7d21af1
feat(schema): add common mesh schema python model
Jul 10, 2023
eaf29f0
chore: add project setup and templates
Aug 1, 2023
5093617
fix: update dev environment
Aug 3, 2023
15c1478
feat(TECHART-292): added pydantic model for material names
Ivan-Sanandres Aug 4, 2023
e7a9e67
feat(TECHART-293): added pydantic model for mesh atributes
Ivan-Sanandres Aug 4, 2023
c8e2553
fix(schema)!: update basemodel to pydantic v2
Aug 8, 2023
6bf25f9
fix(schema)!: update mesh_triangle_count to v2
Aug 8, 2023
b785648
fix(schema)!: update common_mesh to pydantic v2
Aug 8, 2023
fe50924
fix(schema)!: add unified errors to common_mesh
Aug 8, 2023
88e0176
fix(schema): split json_schema_extra into subfuncs
Aug 9, 2023
370f2e0
fix(schema): updated material_names model
Ivan-Sanandres Aug 9, 2023
0332f20
fix(schema): no validate_default in base config
Aug 9, 2023
8994fd2
fix(schema): fix custom validation error
Aug 9, 2023
f2843a4
fix(schema): unify material names error messages
Aug 9, 2023
b5f7b8c
chore: add mypy type checking pre-commit hook
Aug 9, 2023
691c3ca
chore: add pydantic dependency to mypy pre-commit
Aug 9, 2023
a2834fc
fix(linting): ignore ConfigDict kwargs type check
Aug 9, 2023
5a90c56
fix(schema): use dynamically created enums
Aug 10, 2023
411847b
fix(schema): agnostic name for error replacement
Aug 10, 2023
b23a48d
feat: Python model fro generating schema for textures
TechyDaniel Aug 10, 2023
928dae7
Update: disabled D105 check for ruff
TechyDaniel Aug 10, 2023
f0ab5b6
chore: ruff ignore missing doc-string in __init__
Aug 10, 2023
12a9c8e
fix(Schema): revised meshAttributes schema, added skeleton of pydanti…
Ivan-Sanandres Aug 11, 2023
8cfe26e
feat: MVP
TechyDaniel Aug 14, 2023
68f700c
chore(pre-commit): add git msg linting for conventional commits
Aug 15, 2023
8b9460c
feat(Pydantic): :sparkles: Added Asset_Glass Model for Json Schema -M…
TechyDaniel Aug 15, 2023
b019818
fix(Schema): :bug: Fixing validation for glasses and minor changes to…
TechyDaniel Aug 16, 2023
1760f8a
feat(validators): add custom error handler
Aug 17, 2023
beb1e57
feat(schema): add animation sub-schema
Aug 17, 2023
ab236f5
feat(io): add write json function
Aug 18, 2023
63fd72c
feat(io): use write_json func to write schema
Aug 18, 2023
6c18055
fix(io): use $id property as schema file name
Aug 19, 2023
a8200fc
feat(io): add writing common_mesh schema to json
Aug 19, 2023
3702b4f
refactor(schema): move json schema generator
Aug 19, 2023
249b669
style: remove ellipses from Field call
Aug 19, 2023
87a8dac
refactor(schema): reusable properties comment
Aug 20, 2023
18d9baa
fix(schema): use enum values instead of names
Aug 20, 2023
953c9fd
refactor: dynamic enum class func
Aug 20, 2023
b29aef1
refactor(schema): common textures properties
Aug 20, 2023
bdc476f
fix(schema): glasses schema wip empty objects
Aug 20, 2023
a0d716c
feat: Added error message wrapper
TechyDaniel Aug 22, 2023
c01ffc0
chore: bump pydantic to 2.2
Aug 23, 2023
45f3173
feat(schema): error msg func for length of input
Aug 23, 2023
e80bb3d
chore: bump pydantic to 2.3, mypy to 1.5.1
Aug 24, 2023
965b8ad
refactor(schema): custom field module
Aug 24, 2023
5c9529c
refactor(schema): smaller basemodel module
Aug 24, 2023
7441571
refactor(schema): animation
Aug 24, 2023
7464463
refactor(schema): material names
Aug 24, 2023
79276b8
feat(schema): custom StrEnum type
Aug 24, 2023
d2b5a3d
fix(schema): disable strict mode
Aug 24, 2023
ac77713
chore: bump mypy, ruff versions
Aug 24, 2023
d015b4f
fix(schema): common texture rename, error messages
Aug 24, 2023
b558374
fix(schema): asset glasses common_texture import
Aug 24, 2023
6283b07
style(schema): change type ignore issue
Aug 24, 2023
306cd80
feat: added empty keys to match the Json instance
TechyDaniel Aug 25, 2023
547b91a
feat: added scenes placeholder
TechyDaniel Aug 25, 2023
6bcb3fe
docs(contributing): update pre-commit install command
Aug 28, 2023
7a7f1dc
docs(contributing): consistent code blocks
Aug 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .docstr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
paths: # list or string
- src/readyplayerme
#badge: docs # Path to save SVG file
exclude: .*/tests # regex
verbose: 3 # int (0-4)
skip_magic: True # Boolean
skip_file_doc: True # Boolean
skip_init: True # Boolean
skip_class_def: False # Boolean
skip_private: True # Boolean
follow_links: True # Boolean
accept_empty: True # Boolean
ignore_names_file: .*/tests # regex
fail_under: 25 # int
percentage_only: False # Boolean
ignore_patterns: # Dict with key/value pairs of file-pattern/node-pattern
.*:
- process
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @Olaf-Wolf3D will be requested for review when someone opens a pull request.
* @Olaf-Wolf3D @TechyDaniel
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''

---

**Which plugin**
If the bug relates to a pyblish plugin, write which one.

**Describe the bug**
A clear and concise description of what the bug is.

**Reproduction rate**
percentage of how often it happens, always or sometimes?

**Reproduction steps**
describe the steps to reproduce the behavior, step 1. 2. 3. ..

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**

- OS: [e.g. Windows]
- Version [e.g. 11]

**Blender (please complete the following information):**

- Version: [e.g. 3.3 LTS]
- Installation type: [e.g. installer, portable, blender launcher, steam, windows store]

**Additional context**
Add any other context about the problem here.
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to an existing Ready Player Me pyblish plugin?**
Mention plugin here.

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.

**Describe the solution you'd like**
A clear and concise description of what you want to happen. Ideally, use Gherkin syntax.
Example:

```Gherkin
Feature: Action to make all materials single-sided
Let users quickly make _all_ materials single-sided, regardless of validation state.

Rule: Make all materials single-sided
Background:
Given I have materials

Example: two-sided materials
Given I have run the validation
And at least one of the materials is two-sided
When I choose the single-sided materials action in the validator
Then all materials are single-sided

Example: one-sided materials
Given I have run the validation
And there are no two-sided materials
Then I still have the option to make all materials one-sided
...
```

**Describe the impact**
Gauge how much __impact__ this feature would have for its users [e.g. how much time it will save].
What is its value?

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
41 changes: 41 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Description

Please include a summary of the changes and the related issue.
Please also include relevant motivation and context.
List any dependencies that are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration.

- [ ] Test A
- [ ] Test B

**Test Configuration**:
* Blender version:
* Installation type [Ex. portable, installation, Steam, Windows store]:

# Checklist:

- [ ] I confirm that the changes meet the user experience and goals outlined in the design plan (if there is one).
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have updated any version info, if necessary.
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: test

on:
push:
branches: [main]
pull_request:
branches: [main]
types: [ready_for_review, reopened]

concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
run:
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.10']

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Hatch
run: pip install --upgrade hatch

- name: Run tests
run: hatch run cov

- name: Run linting
run: hatch run lint:all
Loading