Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
*.swp
build/
demo/README.rst
docs/build
docs/build
docs/_build.py
12 changes: 2 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,8 @@
# built documents.
#
# The full version, including alpha/beta/rc tags.
_path = os.path.abspath(f'{__file__}/../../src/__init__.py')
with open(_path) as f:
for line in f:
match = re.search('pymupdf_version = "([0-9][.][0-9]+[.][0-9]+(rc[0-9]+)?)"', line)
if match:
release = match.group(1)
print(f'{__file__}: setting version from {_path}: {release}')
break
else:
raise Exception(f'Failed to find `VersionBind = ...` in {_path}')
from _build import pymupdf_version as release # noqa F401
print(f'{__file__}: setting version from _build.py: {release}')

# The short X.Y version
version = release
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,8 @@ def add(flavour, from_, to_):
text += f'pymupdf_git_diff = {diff!r}\n'
text += f'pymupdf_git_branch = {branch!r}\n'
add('p', text.encode(), f'{to_dir}/_build.py')
with open('docs/_build.py', 'w') as f:
f.write(text)

# Add single README file.
if 'p' in PYMUPDF_SETUP_FLAVOUR:
Expand Down