-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from XXXFQ:develop
Initialize versioning and update project structure
- Loading branch information
Showing
10 changed files
with
527 additions
and
62 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
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Allow direct execution | ||
import os | ||
import sys | ||
|
||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | ||
|
||
import toml | ||
|
||
VERSION_TEMPLATE = '''\ | ||
# Autogenerated by devscripts/update-version.py | ||
__version__ = {version!r} | ||
''' | ||
|
||
def read_pyproject_version(pyproject_path="pyproject.toml") -> str: | ||
''' | ||
Read version information from pyproject.toml. | ||
Parameters | ||
---------- | ||
pyproject_path : str | ||
Path to pyproject.toml | ||
Returns | ||
------- | ||
str | ||
Version information | ||
''' | ||
with open(pyproject_path, "r") as f: | ||
pyproject = toml.load(f) | ||
return pyproject["tool"]["poetry"]["version"] | ||
|
||
def write_version_file(version, output_path="radiko_recorder/version.py"): | ||
''' | ||
Write version information to version.py. | ||
Parameters | ||
---------- | ||
version : str | ||
Version information | ||
output_path : str | ||
Path to version.py | ||
''' | ||
with open(output_path, "w") as f: | ||
f.write(VERSION_TEMPLATE.format(version=version)) | ||
print(f"version.py has been generated with version: {version}") | ||
|
||
if __name__ == "__main__": | ||
version = read_pyproject_version() | ||
write_version_file(version) |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[tool.poetry] | ||
name = "radiko-recorder" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["ARM0930 <72128692+XXXFQ@users.noreply.github.com>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.11,<3.14" | ||
beautifulsoup4 = "^4.12.3" | ||
colorlog = "^6.9.0" | ||
ffmpeg-python = "^0.2.0" | ||
requests = "^2.32.3" | ||
python-dotenv = "^1.0.1" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pyinstaller = "^6.11.0" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
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
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 |
---|---|---|
@@ -1,12 +1,8 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
from dotenv import load_dotenv | ||
|
||
# 環境変数へ反映 | ||
load_dotenv() | ||
|
||
RADIKO_AREA_ID = os.getenv('RADIKO_AREA_ID') | ||
|
||
OUTPUT_DIR = Path("output") | ||
OUTPUT_DIR.mkdir(exist_ok=True) | ||
RADIKO_AREA_ID = os.getenv('RADIKO_AREA_ID') |
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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Autogenerated by devscripts/update-version.py | ||
|
||
__version__ = '0.1.0' |
This file was deleted.
Oops, something went wrong.
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