sing-box-cli 0.0.3__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.
- sing_box_cli-0.0.3/.github/dependabot.yml +16 -0
- sing_box_cli-0.0.3/.github/workflows/main.yml +102 -0
- sing_box_cli-0.0.3/.gitignore +163 -0
- sing_box_cli-0.0.3/.pre-commit-config.yaml +50 -0
- sing_box_cli-0.0.3/.vscode/PythonImportHelper-v2-Completion.json +412 -0
- sing_box_cli-0.0.3/.vscode/settings.json +12 -0
- sing_box_cli-0.0.3/CHANGELOG.md +15 -0
- sing_box_cli-0.0.3/LICENSE +21 -0
- sing_box_cli-0.0.3/PKG-INFO +75 -0
- sing_box_cli-0.0.3/README.md +30 -0
- sing_box_cli-0.0.3/assets/image.png +0 -0
- sing_box_cli-0.0.3/mkdocs.yml +183 -0
- sing_box_cli-0.0.3/pyproject.toml +240 -0
- sing_box_cli-0.0.3/scripts/bump.sh +8 -0
- sing_box_cli-0.0.3/scripts/format.sh +5 -0
- sing_box_cli-0.0.3/scripts/lint.sh +8 -0
- sing_box_cli-0.0.3/src/sing_box_service/__init__.py +5 -0
- sing_box_cli-0.0.3/src/sing_box_service/config.py +94 -0
- sing_box_cli-0.0.3/src/sing_box_service/main.py +144 -0
- sing_box_cli-0.0.3/src/sing_box_service/py.typed +0 -0
- sing_box_cli-0.0.3/src/sing_box_service/service.py +172 -0
- sing_box_cli-0.0.3/uv.lock +674 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
|
|
4
|
+
- package-ecosystem: pip
|
|
5
|
+
directory: "/"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: "weekly"
|
|
8
|
+
commit-message:
|
|
9
|
+
prefix: "chore(rye)"
|
|
10
|
+
|
|
11
|
+
- package-ecosystem: github-actions
|
|
12
|
+
directory: "/"
|
|
13
|
+
schedule:
|
|
14
|
+
interval: "weekly"
|
|
15
|
+
commit-message:
|
|
16
|
+
prefix: "ci(github-actions)"
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
name: Test And Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
tags:
|
|
7
|
+
- "v*.*.*"
|
|
8
|
+
pull_request:
|
|
9
|
+
branches: [ main ]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
name: Run Tests / OS ${{ matrix.os }} / Python ${{ matrix.python-version }}
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
os: [ ubuntu-latest ]
|
|
17
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
18
|
+
runs-on: ${{ matrix.os }}
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Install uv
|
|
23
|
+
uses: astral-sh/setup-uv@v5
|
|
24
|
+
with:
|
|
25
|
+
enable-cache: true
|
|
26
|
+
|
|
27
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
28
|
+
run: uv python install ${{ matrix.python-version }}
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: uv sync --python ${{ matrix.python-version }} --all-extras --dev
|
|
32
|
+
|
|
33
|
+
- name: Run Pre-commit
|
|
34
|
+
run: uvx pre-commit run --all-files
|
|
35
|
+
|
|
36
|
+
- name: Run linters
|
|
37
|
+
run: uv run bash scripts/lint.sh
|
|
38
|
+
|
|
39
|
+
release:
|
|
40
|
+
name: Bump Version and Release
|
|
41
|
+
needs: test
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
44
|
+
|
|
45
|
+
permissions:
|
|
46
|
+
id-token: write # enable for OIDC [4,5]
|
|
47
|
+
contents: write
|
|
48
|
+
|
|
49
|
+
outputs:
|
|
50
|
+
version: ${{ steps.inspect_package.outputs.version }}
|
|
51
|
+
package: ${{ steps.inspect_package.outputs.package }}
|
|
52
|
+
|
|
53
|
+
environment:
|
|
54
|
+
name: pypi # display pypi in page
|
|
55
|
+
url: https://pypi.org/project/${{ steps.inspect_package.outputs.package }}/${{ steps.inspect_package.outputs.version }}
|
|
56
|
+
|
|
57
|
+
steps:
|
|
58
|
+
- uses: actions/checkout@v4
|
|
59
|
+
with:
|
|
60
|
+
fetch-depth: 0
|
|
61
|
+
|
|
62
|
+
- name: Install uv
|
|
63
|
+
uses: astral-sh/setup-uv@v5
|
|
64
|
+
with:
|
|
65
|
+
enable-cache: true
|
|
66
|
+
|
|
67
|
+
- name: Install dependencies
|
|
68
|
+
run: uv sync --dev
|
|
69
|
+
|
|
70
|
+
# add trusted-publishers on pypi first[6]
|
|
71
|
+
- name: Build
|
|
72
|
+
run: uv build
|
|
73
|
+
|
|
74
|
+
- name: Inspect package version
|
|
75
|
+
id: inspect_package
|
|
76
|
+
run: |
|
|
77
|
+
version=$(uvx hatchling version)
|
|
78
|
+
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
79
|
+
package=$(uvx hatchling metadata | jq -r .name)
|
|
80
|
+
echo "package=$package" >> "$GITHUB_OUTPUT"
|
|
81
|
+
|
|
82
|
+
- name: Publish
|
|
83
|
+
run: uv publish
|
|
84
|
+
|
|
85
|
+
- name: Generate a changelog
|
|
86
|
+
env:
|
|
87
|
+
ATTICUS_PAT: ${{ secrets.ATTICUS_PAT }}
|
|
88
|
+
run: uv run git-cliff -vv --latest --strip header --github-token "$ATTICUS_PAT" -o CHANGES.md
|
|
89
|
+
|
|
90
|
+
- name: Release
|
|
91
|
+
uses: softprops/action-gh-release@v2
|
|
92
|
+
with:
|
|
93
|
+
body_path: CHANGES.md
|
|
94
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
95
|
+
|
|
96
|
+
# Reference
|
|
97
|
+
# 1. https://docs.astral.sh/uv/guides/integration/github/#syncing-and-running
|
|
98
|
+
# 2. https://github.com/Kludex/python-template/blob/main/.github/workflows/main.yml
|
|
99
|
+
# 3. https://github.com/softprops/action-gh-release/tree/master/
|
|
100
|
+
# 4. https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings
|
|
101
|
+
# 5. https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-pypi
|
|
102
|
+
# 6. https://docs.pypi.org/trusted-publishers/adding-a-publisher/
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# poetry
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
+
#poetry.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
110
|
+
.pdm.toml
|
|
111
|
+
|
|
112
|
+
# UV
|
|
113
|
+
.ruff_cache/
|
|
114
|
+
|
|
115
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
116
|
+
__pypackages__/
|
|
117
|
+
|
|
118
|
+
# Celery stuff
|
|
119
|
+
celerybeat-schedule
|
|
120
|
+
celerybeat.pid
|
|
121
|
+
|
|
122
|
+
# SageMath parsed files
|
|
123
|
+
*.sage.py
|
|
124
|
+
|
|
125
|
+
# Environments
|
|
126
|
+
.env
|
|
127
|
+
.venv
|
|
128
|
+
env/
|
|
129
|
+
venv/
|
|
130
|
+
ENV/
|
|
131
|
+
env.bak/
|
|
132
|
+
venv.bak/
|
|
133
|
+
|
|
134
|
+
# Spyder project settings
|
|
135
|
+
.spyderproject
|
|
136
|
+
.spyproject
|
|
137
|
+
|
|
138
|
+
# Rope project settings
|
|
139
|
+
.ropeproject
|
|
140
|
+
|
|
141
|
+
# mkdocs documentation
|
|
142
|
+
/site
|
|
143
|
+
|
|
144
|
+
# mypy
|
|
145
|
+
.mypy_cache/
|
|
146
|
+
.dmypy.json
|
|
147
|
+
dmypy.json
|
|
148
|
+
|
|
149
|
+
# Pyre type checker
|
|
150
|
+
.pyre/
|
|
151
|
+
|
|
152
|
+
# pytype static type analyzer
|
|
153
|
+
.pytype/
|
|
154
|
+
|
|
155
|
+
# Cython debug symbols
|
|
156
|
+
cython_debug/
|
|
157
|
+
|
|
158
|
+
# PyCharm
|
|
159
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
160
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
161
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
162
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
163
|
+
.idea/
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# https://pre-commit.com/
|
|
2
|
+
# `pre-commit install` to set up the git hook scripts
|
|
3
|
+
# `pre-commit autoupdate` to update repos
|
|
4
|
+
# `pre-commit run --all-files` run hooks for all file
|
|
5
|
+
exclude: (^|/)\..* # exclude hidden files or folder
|
|
6
|
+
repos:
|
|
7
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
8
|
+
rev: v5.0.0
|
|
9
|
+
hooks:
|
|
10
|
+
- id: check-toml
|
|
11
|
+
- id: check-yaml
|
|
12
|
+
args: ["--unsafe"]
|
|
13
|
+
- id: check-json
|
|
14
|
+
- id: check-added-large-files
|
|
15
|
+
args: ["--maxkb=51200"]
|
|
16
|
+
- id: debug-statements
|
|
17
|
+
- id: end-of-file-fixer
|
|
18
|
+
- id: trailing-whitespace
|
|
19
|
+
- id: detect-private-key
|
|
20
|
+
- id: destroyed-symlinks
|
|
21
|
+
- id: check-vcs-permalinks
|
|
22
|
+
# spell check
|
|
23
|
+
- repo: https://github.com/codespell-project/codespell
|
|
24
|
+
rev: v2.3.0
|
|
25
|
+
hooks:
|
|
26
|
+
- id: codespell
|
|
27
|
+
files: \.(py|sh|rst|yml|yaml|md)$
|
|
28
|
+
args: [--write-changes]
|
|
29
|
+
# lint and format
|
|
30
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
31
|
+
rev: v0.8.6
|
|
32
|
+
hooks:
|
|
33
|
+
- id: ruff
|
|
34
|
+
args: [ --fix ]
|
|
35
|
+
- id: ruff-format
|
|
36
|
+
# - repo: https://github.com/hadolint/hadolint
|
|
37
|
+
# rev: v2.12.0
|
|
38
|
+
# hooks:
|
|
39
|
+
# - id: hadolint
|
|
40
|
+
# name: Lint Dockerfiles
|
|
41
|
+
# description: Runs hadolint to lint Dockerfiles
|
|
42
|
+
# language: system
|
|
43
|
+
# types: ["dockerfile"]
|
|
44
|
+
# entry: hadolint
|
|
45
|
+
ci:
|
|
46
|
+
# Settings for the https://pre-commit.ci/ continuous integration service
|
|
47
|
+
autofix_prs: True
|
|
48
|
+
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
|
|
49
|
+
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate
|
|
50
|
+
autoupdate_schedule: monthly
|