codeurcv 0.1.0__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codeurcv-0.1.0 → codeurcv-0.2.0}/PKG-INFO +1 -1
- {codeurcv-0.1.0 → codeurcv-0.2.0}/pyproject.toml +8 -2
- codeurcv-0.2.0/src/codeurcv/core/dependency_checker.py +94 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/core/renderer.py +3 -12
- codeurcv-0.2.0/src/codeurcv/core/settings.py +3 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/README.md +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/__init__.py +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/__main__.py +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/cli.py +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/core/constants.py +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/core/logger.py +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/core/markdown_converter.py +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/core/plugin_loader.py +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/core/schema.py +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/core/template_loader.py +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/plugins/__init__.py +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/plugins/base.py +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/plugins/minimalist/__init__.py +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/plugins/minimalist/plugin.py +0 -0
- {codeurcv-0.1.0 → codeurcv-0.2.0}/src/codeurcv/plugins/minimalist/template.tex +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "codeurcv"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.2.0"
|
|
4
4
|
description = "A Python library to generate LaTeX resumes from YAML configuration files using Jinja2 templates."
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "crackedngineer", email = "subhomoyrchoudhury@gmail.com" },
|
|
@@ -33,8 +33,14 @@ packages = [
|
|
|
33
33
|
{ include = "codeurcv", from = "src" },
|
|
34
34
|
]
|
|
35
35
|
|
|
36
|
+
[tool.hatch.build.targets.wheel]
|
|
37
|
+
packages = ["src/codeurcv"]
|
|
38
|
+
|
|
39
|
+
[tool.setuptools.packages.find]
|
|
40
|
+
where = ["src"]
|
|
41
|
+
|
|
36
42
|
[tool.poetry.scripts]
|
|
37
|
-
codeurcv = "
|
|
43
|
+
codeurcv = "codeurcv.__main__:app"
|
|
38
44
|
|
|
39
45
|
[build-system]
|
|
40
46
|
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import shutil
|
|
3
|
+
from codeurcv.core.settings import console
|
|
4
|
+
|
|
5
|
+
INSTALL_INSTRUCTIONS = {
|
|
6
|
+
"pandoc": {
|
|
7
|
+
"win32": [
|
|
8
|
+
("winget", "winget install --id JohnMacFarlane.Pandoc"),
|
|
9
|
+
("choco", "choco install pandoc"),
|
|
10
|
+
],
|
|
11
|
+
"darwin": [
|
|
12
|
+
("brew", "brew install pandoc"),
|
|
13
|
+
],
|
|
14
|
+
"linux": [
|
|
15
|
+
("apt", "sudo apt install pandoc"),
|
|
16
|
+
("dnf", "sudo dnf install pandoc"),
|
|
17
|
+
("pacman", "sudo pacman -S pandoc"),
|
|
18
|
+
("zypper", "sudo zypper install pandoc"),
|
|
19
|
+
("emerge", "sudo emerge app-text/pandoc"),
|
|
20
|
+
("snap", "sudo snap install pandoc"),
|
|
21
|
+
("flatpak", "flatpak install flathub org.pandoc.Pandoc"),
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
"pdflatex": {
|
|
25
|
+
"win32": [
|
|
26
|
+
("winget", "winget install --id MiKTeX.MiKTeX"),
|
|
27
|
+
("choco", "choco install miktex"),
|
|
28
|
+
],
|
|
29
|
+
"darwin": [
|
|
30
|
+
("brew", "brew install --cask mactex"),
|
|
31
|
+
],
|
|
32
|
+
"linux": [
|
|
33
|
+
("apt", "sudo apt install texlive-latex-base"),
|
|
34
|
+
("dnf", "sudo dnf install texlive-latex"),
|
|
35
|
+
("pacman", "sudo pacman -S texlive-basic"),
|
|
36
|
+
("zypper", "sudo zypper install texlive-latex"),
|
|
37
|
+
("emerge", "sudo emerge dev-texlive/texlive-basic"),
|
|
38
|
+
("snap", "sudo snap install texlive"),
|
|
39
|
+
("flatpak", "flatpak install flathub org.texlive.TeXLive"),
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
# Maps package manager → distro label for display
|
|
45
|
+
PM_DISTRO_LABEL = {
|
|
46
|
+
"apt": "Debian / Ubuntu / Mint",
|
|
47
|
+
"dnf": "Fedora / RHEL / CentOS",
|
|
48
|
+
"pacman": "Arch / Manjaro",
|
|
49
|
+
"zypper": "openSUSE",
|
|
50
|
+
"emerge": "Gentoo",
|
|
51
|
+
"snap": "Snap",
|
|
52
|
+
"flatpak": "Flatpak",
|
|
53
|
+
"winget": "winget",
|
|
54
|
+
"choco": "Chocolatey",
|
|
55
|
+
"brew": "Homebrew",
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def get_available_package_managers() -> list[str]:
|
|
60
|
+
managers = ["apt", "dnf", "pacman", "zypper", "emerge", "snap", "flatpak", "winget", "choco", "brew"]
|
|
61
|
+
return [pm for pm in managers if shutil.which(pm) is not None]
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def check_dependencies():
|
|
65
|
+
missing = [t for t in ("pandoc", "pdflatex") if shutil.which(t) is None]
|
|
66
|
+
if not missing:
|
|
67
|
+
return
|
|
68
|
+
|
|
69
|
+
available_pms = get_available_package_managers()
|
|
70
|
+
platform = sys.platform
|
|
71
|
+
|
|
72
|
+
console.print("\n[bold red]Missing dependencies detected:[/bold red]\n")
|
|
73
|
+
|
|
74
|
+
for tool in missing:
|
|
75
|
+
options = INSTALL_INSTRUCTIONS[tool].get(platform, INSTALL_INSTRUCTIONS[tool]["linux"])
|
|
76
|
+
|
|
77
|
+
# Filter to only detected package managers, fallback to all if none matched
|
|
78
|
+
matched = [(pm, cmd) for pm, cmd in options if pm in available_pms] or options
|
|
79
|
+
|
|
80
|
+
console.print(f"[bold yellow]{tool}[/bold yellow] is not installed.")
|
|
81
|
+
|
|
82
|
+
if len(matched) == 1:
|
|
83
|
+
pm, cmd = matched[0]
|
|
84
|
+
label = PM_DISTRO_LABEL.get(pm, pm)
|
|
85
|
+
console.print(f"[dim]Install with ({label}):[/dim] [cyan]{cmd}[/cyan]")
|
|
86
|
+
else:
|
|
87
|
+
console.print(f"[dim]Install with one of:[/dim]")
|
|
88
|
+
for pm, cmd in matched:
|
|
89
|
+
label = PM_DISTRO_LABEL.get(pm, pm)
|
|
90
|
+
console.print(f"[dim]{label:<28}[/dim] [cyan]{cmd}[/cyan]")
|
|
91
|
+
|
|
92
|
+
console.print()
|
|
93
|
+
|
|
94
|
+
raise SystemExit(1)
|
|
@@ -1,35 +1,26 @@
|
|
|
1
1
|
import yaml
|
|
2
|
-
import shutil
|
|
3
2
|
import logging
|
|
4
3
|
import subprocess
|
|
5
4
|
from pathlib import Path
|
|
6
5
|
from datetime import datetime
|
|
7
|
-
from rich.console import Console
|
|
8
6
|
|
|
9
7
|
from codeurcv.core.template_loader import TemplateEngine
|
|
10
8
|
from codeurcv.core.logger import setup_logger
|
|
11
9
|
from codeurcv.core.plugin_loader import load_builtin_plugins
|
|
12
10
|
from codeurcv.core.schema import ResumeConfig
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
from codeurcv.core.settings import console
|
|
12
|
+
from codeurcv.core.dependency_checker import check_dependencies
|
|
16
13
|
|
|
17
14
|
class ResumeRenderer:
|
|
18
15
|
def __init__(self):
|
|
19
16
|
self.plugins = load_builtin_plugins()
|
|
20
|
-
|
|
17
|
+
check_dependencies()
|
|
21
18
|
log_dir = Path("logs")
|
|
22
19
|
log_dir.mkdir(exist_ok=True)
|
|
23
20
|
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
24
21
|
self.log_file = log_dir / f"codeurcv_{timestamp}.log"
|
|
25
22
|
self.logger = setup_logger(debug=False, log_file=self.log_file)
|
|
26
23
|
|
|
27
|
-
@staticmethod
|
|
28
|
-
def _check_dependencies():
|
|
29
|
-
for tool in ("pandoc", "pdflatex"):
|
|
30
|
-
if shutil.which(tool) is None:
|
|
31
|
-
raise RuntimeError(f"{tool} is not installed or not in PATH.")
|
|
32
|
-
|
|
33
24
|
def render(self, config_path: Path, output_dir: Path):
|
|
34
25
|
console.print("\n[bold green]🚀 Building your resume...[/bold green]\n")
|
|
35
26
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|