Closed Mateusz-Grzelinski closed 3 weeks ago
The change should be working now. I tried adding some basic tests, but I did something wrong, because
Note: I have basic experience with tests.
pip install pytest
cd pythonFile
$env:PYTHONPATH="./include" # powershell
pytest -s .\tests\blender_vscode\test_load_addons.py::TestIsInAnyAddonDirectory::test_is_in_any_addon_directory # ok
pytest -s .\tests # 1 ok 5 fail
I think I fixed the tests, but i need to sleep on it.
Those tests are just prototypes that helped me find 2 more errors in my code. I am not sure if this is the right way to test (very complicated test for little code)
The tests are prepared to run outside of blender, and without fake-bpy-module
Ehh, enother long evening.
I am pretty sure this patch works as expected. Final test was done by adding addon and extension to both
\4.2\scripts\addons
\4.2\extensions\blender_org
as seen on screeshot, all looks ok.
The policy violation was fixed in https://github.com/JacquesLucke/blender_vscode/pull/172/commits/445778f950fcc2e33bd62310e98a31d9c8bdc539
I verified that tests work even if fake-bpy-module
is installed.
ugh, breaks older blender. Totally forgot about that. I need to fight the persmission denied error when pip installing and check with blender 2.8 - i think this is the oldest one we support.
Hey, but I am developing this PR on windows, tests should work... Oh, I named the path in Linux style. It does not matter, it works on windows
fixed compability with bledner 2.80. Please squash merge after #174 - it fixes one more issue with 2.80 compability
updated to newest master, ready to merge as 174 was completed.
Covered one more edge case
Agr, last changes from other PRs broke the tests...
the tests are fixed. but I just thought about yet another corner case:
there are problems with python 3.7 and dealing with junctions in windows. They are not recognized correctly and give different errors than python 3.12
This became very involving change, hopefully this is last iteration and I will merge it on the weekend. Before release Linux needs some testing.
tested on ubuntu 22.04 snap installed blender 4.2. Works fine. Merging.
In this PR:
\4.2\scripts\addons
-> default dir for addons\4.2\extensions\blender_org
-> directory indicated bybpy.context.preferences.extensions.repos
(list of directories)Squash merge when ready. Please squash merge after https://github.com/JacquesLucke/blender_vscode/pull/174 - it fixes one more issue with 2.80 compability
About tests:
bpy
andaddon_utils
are not necessary for testsI could not figure out how to run tests with VS code UI. Works fine with pycharm UI when you mark include directory as source directory.
todo:
Corner cases (for documentation):