Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit e5efb46

Browse files
committed
Add toml package to project dependencies
The information is obtained from the pyproject.toml file when possible.
1 parent 7a6af38 commit e5efb46

File tree

4 files changed

+26
-17
lines changed

4 files changed

+26
-17
lines changed

poetry.lock

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ myst-parser = "^1.0.0"
4040
sphinxcontrib-bibtex = "^2.5.0"
4141
sphinxcontrib-mermaid = "^0.8.1"
4242
sphinx-copybutton = "^0.5.2"
43-
44-
[tool.poetry.dev-dependencies]
43+
toml = "^0.10.2"
4544

4645
[build-system]
4746
requires = ["poetry-core>=1.0.0"]

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.9" and python_version < "4.0"
3737
sphinxcontrib-mermaid==0.8.1 ; python_version >= "3.9" and python_version < "4.0"
3838
sphinxcontrib-qthelp==1.0.6 ; python_version >= "3.9" and python_version < "4.0"
3939
sphinxcontrib-serializinghtml==1.1.9 ; python_version >= "3.9" and python_version < "4.0"
40+
toml==0.10.2 ; python_version >= "3.9" and python_version < "4.0"
4041
urllib3==2.1.0 ; python_version >= "3.9" and python_version < "4.0"
4142
zipp==3.17.0 ; python_version >= "3.9" and python_version < "3.10"

src/conf.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,22 @@
44
from datetime import datetime
55
from pathlib import Path
66

7+
import toml
8+
79
# set up paths
810
BASE_DIR = Path(__file__).resolve().parent.parent
911
sys.path.insert(0, str(BASE_DIR / "problem-sets" / "src"))
1012

13+
# read project data from toml file
14+
with open(BASE_DIR / "pyproject.toml") as io_buff:
15+
project_data = toml.load(io_buff)["tool"]["poetry"]
16+
1117
# project information
1218
project = "Python Training Course"
1319
project_copyright = \
1420
f"{datetime.now().year}, Python training course authors and contributors"
15-
authors = "Vladyslav Ponomaryov \\and " \
16-
"Serhii Horodilov"
17-
version = "2023.09.dev"
21+
authors = " \\and ".join(project_data["authors"])
22+
version = project_data["version"]
1823

1924
# general configuration
2025
master_doc = root_doc = "index"
@@ -63,17 +68,9 @@
6368
("appx/software_list", "Software.tex", project, authors, "howto", False),
6469
("appx/code_edit", "IDE.tex", project, authors, "howto", False),
6570
("appx/blog/spec", "DjangoBlog.tex", project, authors, "howto", False),
66-
("appx/assignments", "CreatingPullRequest.tex", "Creating the Pull Request",
67-
authors, "howto", False),
71+
("appx/assignments", "CreatingPullRequest.tex",
72+
"Creating the Pull Request", authors, "howto", False),
6873
]
6974
latex_appendices = [
70-
"appx/software_list",
71-
"appx/code_edit",
72-
"appx/env_path",
73-
"appx/precedence",
74-
"appx/printf",
75-
"appx/assignments",
76-
"appx/conv_store",
77-
"appx/wtk",
78-
"appx/blog/spec",
75+
# TODO: review appendices list
7976
]

0 commit comments

Comments
 (0)