Skip to content

Commit d8aadb4

Browse files
committed
Bump to stable version
1 parent 1fe9edc commit d8aadb4

File tree

7 files changed

+46
-9
lines changed

7 files changed

+46
-9
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v2.12.0
3+
rev: v2.19.1
44
hooks:
55
- id: pyupgrade
66
args:
77
- --py36-plus
88
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v3.4.0
9+
rev: v4.0.1
1010
hooks:
1111
- id: end-of-file-fixer
1212
name: end-of-file-fixer
@@ -15,13 +15,13 @@ repos:
1515
hooks:
1616
- id: setup-cfg-fmt
1717
- repo: https://github.com/psf/black
18-
rev: 20.8b1
18+
rev: 21.5b2
1919
hooks:
2020
- id: black
2121
language_version: python3
2222
files: \.py$
2323
- repo: https://github.com/PyCQA/flake8
24-
rev: 3.9.1
24+
rev: 3.9.2
2525
hooks:
2626
- id: flake8
2727
additional_dependencies:

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![Python versions][pypi-pyversions-badge-link]][pypi-link]
55
[![License][license-image]][license-link]
66
[![Tests][tests-image]][tests-link]
7+
[![Downloads][pypi-downloads-image]][pypi-downloads-link]
78

89
Pytest plugin for Blender testing. Executes your pytest testsuite with
910
Blender in headless mode using its builtin Python interpreter.
@@ -210,4 +211,6 @@ jobs:
210211
[license-link]: https://github.com/mondeja/pytest-blender/blob/master/LICENSE
211212
[tests-image]: https://img.shields.io/github/workflow/status/mondeja/pytest-blender/CI
212213
[tests-link]: https://github.com/mondeja/pytest-blender/actions?query=workflow%3ACI
214+
[pypi-downloads-image]: https://img.shields.io/pypi/dm/pytest-blender
215+
[pypi-downloads-link]: https://pypistats.org/packages/pytest-blender
213216
[blender-downloader-link]: https://github.com/mondeja/blender-downloader

pytest_blender/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.5"
1+
__version__ = "1.0.0"

pytest_blender/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pytest_blender.utils import which_blender_by_os
77

88

9-
__description__ = "Show a Blender builtin Python interpreter location."
9+
__description__ = "Show a Blender's builtin Python interpreter location."
1010

1111

1212
def build_parser():

pytest_blender/run_pytest.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ def _join(value):
2626

2727
# this function can't be in 'utils'
2828
def get_blender_binary_path_python(blender_executable):
29+
"""Get Blender's Python executable location.
30+
31+
This function can't be in utils because the module is not loaded from
32+
Blender (current script is executed inside Blender's Python executable).
33+
34+
Parameters
35+
----------
36+
37+
blender_executable : str
38+
Blender's executable location.
39+
40+
Returns
41+
-------
42+
43+
str: Blender's Python executable path.
44+
"""
2945
stdout = subprocess.check_output(
3046
[
3147
blender_executable,
@@ -62,6 +78,11 @@ def main():
6278
argv.append(arg)
6379

6480
class PytestBlenderPlugin:
81+
"""Pytest plugin used by pytest-blender.
82+
83+
Injects all the fixtures in the Blender's PyTest session of the user.
84+
"""
85+
6586
def _blender_python_executable(self, request):
6687
blender_python_executable = request.config.cache.get(
6788
"pytest-blender/blender-python-executable",
@@ -79,14 +100,17 @@ def _blender_python_executable(self, request):
79100

80101
@pytest.fixture
81102
def blender_executable(self):
103+
"""Get the executable of the current Blender's session."""
82104
return blender_executable
83105

84106
@pytest.fixture
85107
def blender_python_executable(self, request):
108+
"""Get the executable of the current Blender's Python session."""
86109
return self._blender_python_executable(request)
87110

88111
@pytest.fixture
89112
def blender_version(self, request):
113+
"""Get the Blender version of the current session."""
90114
blender_version = request.config.cache.get(
91115
"pytest-blender/blender-version",
92116
None,
@@ -106,6 +130,7 @@ def blender_version(self, request):
106130

107131
@pytest.fixture
108132
def blender_python_version(self, request):
133+
"""Get the version of the Blender's Python executable."""
109134
blender_python_version = request.config.cache.get(
110135
"pytest-blender/blender-python-version",
111136
None,
@@ -131,6 +156,12 @@ def blender_python_version(self, request):
131156

132157
@pytest.fixture(scope="session")
133158
def install_addons_from_dir(self, request):
159+
"""Install Blender's addons from directory.
160+
161+
Installs a set of Blender's addons into the current Blender's
162+
session specifying the names of the addons to be installed.
163+
"""
164+
134165
def _install_addons_from_dir(
135166
addons_dir,
136167
addon_module_names,
@@ -157,6 +188,8 @@ def _install_addons_from_dir(
157188

158189
@pytest.fixture(scope="session")
159190
def disable_addons(self, request):
191+
"""Disable installed addons in the current Blender's session."""
192+
160193
def _disable_addons(
161194
addon_module_names,
162195
save_userpref=True,

pytest_blender/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44

55
def which_blender_by_os():
6+
"""Get the expected Blender executable location by operative system."""
67
if sys.platform == "darwin":
78
return "Blender"
89
return "blender.exe" if "win" in sys.platform else shutil.which("blender")

setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pytest_blender
3-
version = 0.0.5
3+
version = 1.0.0
44
description = Blender Pytest plugin.
55
long_description = file: README.md
66
long_description_content_type = text/markdown
@@ -48,8 +48,8 @@ dev =
4848
pytest==6.2.1
4949
yamllint==1.26.1
5050
lint =
51-
black==20.8b1
52-
flake8==3.9.1
51+
black==21.5b2
52+
flake8==3.9.2
5353
flake8-implicit-str-concat==0.2.0
5454
flake8-print==4.0.0
5555
isort==5.8.0

0 commit comments

Comments
 (0)