Skip to content

Commit

Permalink
Merge pull request #114 from Nusiq/stub-files
Browse files Browse the repository at this point in the history
Add custom version of `fake_bpy_modules` to the project
  • Loading branch information
Nusiq committed Jun 22, 2024
2 parents 138937b + 66ea2bb commit 849ea5b
Show file tree
Hide file tree
Showing 362 changed files with 571,899 additions and 1,506 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,19 @@ jobs:
- name: Install dependencies
run: |
sudo snap install blender --channel=3.3lts/stable --classic
pip install pyright pytest numpy fake-bpy-module-3.4
cd $GITHUB_WORKSPACE
pip install pyright pytest numpy ./fake_bpy_modules
- name: Build and install the addon
run: |
cd $GITHUB_WORKSPACE
python --version
zip_name=$(python build.py | grep 'mcblend_[0-9.]*.zip' -o)
blender -b --python ./blender_scripts/install.py -- "$GITHUB_WORKSPACE/$zip_name"
- name: Test syntax with mypy
- name: Static Type Checking (Pyright)
run: |
cd $GITHUB_WORKSPACE
python -m pyright ./mcblend
- name: PyTest tests
- name: Tests (Pytest)
run: |
cd $GITHUB_WORKSPACE
python -m pytest
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ Feel free to reach out to me on the #mcblend channel of the [Bedrock OSS](https:

## 💡 Planned features
Some of the planned features for the Mcblend project can be found in the ["Issues"](https://github.com/Nusiq/mcblend/issues) tab of this repository.

## 📜 License

The license for Mcblend plugin can be found in the the "LICENSE" file.

The project uses a modified version of [fake-bpy-module](https://github.com/nutti/fake-bpy-module) for type checking (stored in the "fake_bpy_modules" directory). The license for the fake-bpy-module can be found in the "fake_bpy_modules/LICENSE" file.
2 changes: 2 additions & 0 deletions fake_bpy_modules/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
fake_bpy_modules_mcblend.egg-info
22 changes: 22 additions & 0 deletions fake_bpy_modules/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2017 Nutti (original version: https://github.com/nutti/fake-bpy-module)
Copyright (c) 2024 Nusiq (modified version for Mcblend)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions fake_bpy_modules/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This module is based on: `fake_bpy_modules_3.6-20231118.zip` from the Fake Bpy Module project. The original project can be found at:
https://github.com/nutti/fake-bpy-module/releases/tag/20231118


This module is used to provide type checking for Blender's bpy and mathutils module in the Mcblend project. The default fake-bpy-module was insufficient for Mcblend because of its inacuracies and lack of types that are specific to Mcblend.

> [!WARNING]
> This project is not useful for developing other Blender addons. If you're looking for a fake bpy module, please use the original project instead or create your own fork if your project requires additional types.
76 changes: 76 additions & 0 deletions fake_bpy_modules/addon_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import sys
import typing

GenericType = typing.TypeVar("GenericType")


def check(module_name):
'''
'''

pass


def disable(module_name, default_set, handle_error):
'''
'''

pass


def disable_all():
'''
'''

pass


def enable(module_name, default_set, persistent, handle_error):
'''
'''

pass


def module_bl_info(mod, info_basis):
'''
'''

pass


def modules(module_cache, refresh):
'''
'''

pass


def modules_refresh(module_cache):
'''
'''

pass


def paths():
'''
'''

pass


def reset_all(reload_scripts):
'''
'''

pass
Empty file.
55 changes: 55 additions & 0 deletions fake_bpy_modules/animsys_refactor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import sys
import typing

GenericType = typing.TypeVar("GenericType")


class DataPathBuilder:
data_path = None
''' '''

def resolve(self, real_base, rna_update_from_map, fcurve, log):
'''
'''
pass


def anim_data_actions(anim_data):
'''
'''

pass


def classes_recursive(base_type, clss):
'''
'''

pass


def find_path_new(id_data, data_path, rna_update_from_map, fcurve, log):
'''
'''

pass


def id_iter():
'''
'''

pass


def update_data_paths(rna_update, log):
'''
'''

pass
Empty file.
Loading

0 comments on commit 849ea5b

Please sign in to comment.