Skip to content

Commit

Permalink
重构项目结构,更新依赖管理,优化代码组织,所以是v0.2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Shua-github committed Jan 26, 2025
1 parent cac51fd commit e10c051
Show file tree
Hide file tree
Showing 22 changed files with 1,179 additions and 59 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
- main # 监听 main 分支上的 push 事件
paths:
- '**/*.py' # 监听所有 .py 文件
- 'requirements.txt' # 监听 requirements.txt 文件
- 'pyproject.toml'
- 'pdm.lock'

jobs:
build:
Expand All @@ -22,19 +23,23 @@ jobs:
python-version: '3.12' # 配置 Python 版本
architecture: 'x64'

- name: Install Requirements
- name: Install PDM
run: |
pip install -r requirements.txt
python -m pip install pdm
- name: Run Nuitka build with app.py
- name: Install Dependencies
run: |
pdm install --production
- name: Run Nuitka build with onefile mode
uses: Nuitka/Nuitka-Action@main
with:
script-name: app.py
script-name: jmcomic_api/__main__.py
mode: onefile
nuitka-version: main

- name: Upload build files
uses: actions/upload-artifact@v4
with:
name: build-app # Artifact 的名称,可以自定义
path: build/ # 上传的文件或目录的路径
name: build-ok-app # Artifact 的名称,可以自定义
path: build/ # 上传的文件或目录的路径
168 changes: 165 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,166 @@
temp_output
temp_image
# Byte-compiled / optimized / DLL files
**/__pycache__/
venv
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm-project.org/#use-with-ide
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# temp path
**/temp_output/
**/temp_image/
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,39 @@
- [x] 传入本子`ID`返回`JSON`或文件
- [x] 文件提供
- [ ] 支持传入列表以批量下载本子
- [ ] 支持传入配置,针对用户长期记忆配置
- [ ] 支持传入配置针对用户长期记忆配置
- [ ] 提供输出加密

## 运行
### `Windows`用户
1. 前往[Releases](https://github.com/Shua-github/JMComic-API-Python/releases)下载压缩包
2. 解压到一个文件夹
3. 运行`app.exe`

### 其它
1. 环境:理论`Python`>=`3.10`均可(推荐使用`3.12`)
2. 拉取本项目```git clone https://github.com/Shua-github/JMComic-API-Python.git```
3. 运行`venv_config.sh`
4. 执行`python app.py`
### 推荐(通用)
1. **环境**
```plaintext
理论 Python >= 3.10 均可(推荐使用 3.12)
```
2. **安装**
```bash
pip install jmcomic-api
```
3. **运行**
```bash
python -m jmcomic-api
```
### Windows 用户
1. 前往 [Releases](https://github.com/Shua-github/JMComic-API-Python/releases) 下载 [Windows_OneFile](https://github.com/Shua-github/JMComic-API-Python/releases/latest/download/Windows_OneFile.zip)
2. 解压到一个文件夹
3. 运行 `app.exe`
## 默认配置
`网络配置``核心配置路径``RunConfig.yml`,`核心配置``CoreConfig.yml`
配置路径均在软件输出,可以使用 `-c <路径>` 来指定配置路径
## 使用
访问`主机:端口/docs`查看`FastAPI`自带的文档(默认端口是`5000`)
访问 [http://Host:Port/docs](http://localhost:5000/docs) 查看 FastAPI 自带的文档默认端口是 5000
## 谢谢他们和它们
- [JMComic-Crawler-Python](https://github.com/hect0x7/JMComic-Crawler-Python)

- [![Contributors](https://contributors-img.web.app/image?repo=Shua-github/JMComic-API-Python)](https://github.com/Shua-github/JMComic-API-Python/graphs/contributors)
## 其它
出现问题请开`issues`
出现问题请开 issues
29 changes: 0 additions & 29 deletions app.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions jmcomic_api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .JMComicAPICore import (run,return_app as app,FastAPI_App)
Loading

0 comments on commit e10c051

Please sign in to comment.