This repository has been archived by the owner on Mar 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Finn Rodenberg
committed
Aug 19, 2020
1 parent
c5a9117
commit 9fecc7e
Showing
1 changed file
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,23 +18,33 @@ | |
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
|
||
|
||
author = 'CFEL Controlled Molecule Imaging group' | ||
copyright = '2018–2020 CFEL Controlled Molecule Imaging group <[email protected]>' | ||
name = 'pymepix' | ||
project = name | ||
version = '1.1.dev0' | ||
release = version | ||
|
||
import os | ||
import sys | ||
import pathlib | ||
|
||
# accessing the setup.py file to get current information about the project | ||
name, project, version, release, author, copyright = [None] * 6 | ||
desired = ['copyright', 'project', 'name', 'version', 'release', 'author'] | ||
|
||
# importlib.util.spec_from_file_location didn't work as I hoped it would | ||
# first get the path of the setup.py file | ||
current_path = pathlib.Path(__file__).parent.absolute() | ||
setup_path = current_path.parent.joinpath("setup.py") | ||
|
||
# access setup.py as text file to find the necessary lines, then execute those | ||
with open(setup_path, 'r') as f: | ||
for i, line in enumerate(f): | ||
line = line.strip() | ||
line_list = line.split() | ||
if len(line_list) > 0 and line_list[0] in desired: | ||
exec(line) | ||
desired.remove(line_list[0]) | ||
|
||
sys.path.insert(0, os.path.abspath('../../lib/')) | ||
print(sys.path) | ||
|
||
# -- General configuration ------------------------------------------------ | ||
|
||
author = 'CFEL Controlled Molecule Imaging group' | ||
|
||
# If your documentation needs a minimal Sphinx version, state it here. | ||
# | ||
# needs_sphinx = '1.0' | ||
|