Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit be15d59

Browse files
update CLI to v2: testing, typing, many smaller fixes, uses SDK
1 parent c2a8b51 commit be15d59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+197296
-1870
lines changed

‎.github/workflows/pr-preview.yml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: PR Preview
22
on:
33
pull_request:
4-
types: [opened, synchronize]
4+
types: [opened, synchronize, ready_for_review]
55

66
jobs:
77
preview:
@@ -12,9 +12,15 @@ jobs:
1212
with:
1313
python-version: '3.x'
1414

15+
# Install all dependencies from pyproject.toml
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install -e .
20+
1521
- name: Set preview version
1622
run: |
17-
BASE_VERSION=$(grep -o "__version__.*" socketsecurity/__init__.py | awk '{print 3ドル}' | tr -d "'")
23+
BASE_VERSION=$(python -c "from socketsecurity import __version__; print(__version__)")
1824
PREVIEW_VERSION="${BASE_VERSION}.dev${{ github.event.pull_request.number }}${{ github.event.pull_request.commits }}"
1925
echo "VERSION=${PREVIEW_VERSION}" >> $GITHUB_ENV
2026
@@ -25,7 +31,7 @@ jobs:
2531
2632
# Verify the change
2733
echo "Updated version in __init__.py:"
28-
cat socketsecurity/__init__.py | grep "__version__"
34+
python -c "from socketsecurity import __version__; print(__version__)"
2935
3036
- name: Check if version exists on Test PyPI
3137
id: version_check

‎.github/workflows/release.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ jobs:
1313
with:
1414
python-version: '3.x'
1515

16+
# Install all dependencies from pyproject.toml
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install -e .
21+
1622
- name: Get Version
1723
id: version
1824
run: |
@@ -104,4 +110,4 @@ jobs:
104110
socketdev/cli:latest
105111
socketdev/cli:${{ env.VERSION }}
106112
build-args: |
107-
CLI_VERSION=${{ env.VERSION }}
113+
CLI_VERSION=${{ env.VERSION }}

‎.github/workflows/version-check.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Version Check
22
on:
33
pull_request:
4-
types: [opened, synchronize]
4+
types: [opened, synchronize, ready_for_review]
55
paths:
66
- 'socketsecurity/**'
77
- 'setup.py'

‎.gitignore‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ dist
66
*.build
77
*.dist
88
*.egg-info
9-
test
109
*.env
1110
run_container.sh
1211
*.zip
1312
bin
1413
scripts/*.py
1514
*.json
15+
!tests/**/*.json
1616
markdown_overview_temp.md
1717
markdown_security_temp.md
1818
.DS_Store
1919
*.pyc
2020
test.py
2121
*.cpython-312.pyc`
2222
file_generator.py
23-
.env.local
23+
.coverage
24+
.env.local
25+
Pipfile

‎.python-version‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

‎Makefile‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
.PHONY: setup compile-deps sync-deps clean test lint init-tools local-dev first-time-setup update-deps dev-setup sync-all first-time-local-setup
2+
3+
# Environment variable for local SDK path (optional)
4+
SOCKET_SDK_PATH ?= ../socket-sdk-python
5+
6+
# Environment variable to control local development mode
7+
USE_LOCAL_SDK ?= false
8+
9+
# === High-level workflow targets ===
10+
11+
# First-time repo setup after cloning (using PyPI packages)
12+
first-time-setup: clean setup
13+
14+
# First-time setup for local development (using local SDK)
15+
first-time-local-setup:
16+
$(MAKE) clean
17+
$(MAKE) USE_LOCAL_SDK=true dev-setup
18+
19+
# Update dependencies after changing pyproject.toml
20+
update-deps: compile-deps sync-deps
21+
22+
# Setup for local development
23+
dev-setup: clean local-dev setup
24+
25+
# Sync all dependencies after pulling changes
26+
sync-all: sync-deps
27+
28+
# === Implementation targets ===
29+
30+
# Creates virtual environment and installs pip-tools
31+
init-tools:
32+
python -m venv .venv
33+
. .venv/bin/activate && pip install pip-tools
34+
35+
# Installs dependencies needed for local development
36+
# Currently: socket-sdk-python from test PyPI or local path
37+
local-dev: init-tools
38+
ifeq ($(USE_LOCAL_SDK),true)
39+
. .venv/bin/activate && pip install -e $(SOCKET_SDK_PATH)
40+
endif
41+
42+
# Creates/updates requirements.txt files with locked versions based on pyproject.toml
43+
compile-deps: local-dev
44+
. .venv/bin/activate && pip-compile --output-file=requirements.txt pyproject.toml
45+
. .venv/bin/activate && pip-compile --extra=dev --output-file=requirements-dev.txt pyproject.toml
46+
. .venv/bin/activate && pip-compile --extra=test --output-file=requirements-test.txt pyproject.toml
47+
48+
# Creates virtual environment and installs dependencies from pyproject.toml
49+
setup: compile-deps
50+
. .venv/bin/activate && pip install -e ".[dev,test]"
51+
52+
# Installs exact versions from requirements.txt into your virtual environment
53+
sync-deps:
54+
. .venv/bin/activate && pip-sync requirements.txt requirements-dev.txt requirements-test.txt
55+
ifeq ($(USE_LOCAL_SDK),true)
56+
. .venv/bin/activate && pip install -e $(SOCKET_SDK_PATH)
57+
endif
58+
59+
# Removes virtual environment and cache files
60+
clean:
61+
rm -rf .venv
62+
find . -type d -name "__pycache__" -exec rm -rf {} +
63+
64+
test:
65+
pytest
66+
67+
lint:
68+
ruff check .
69+
ruff format --check .

‎Pipfile‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎Pipfile.lock‎

Lines changed: 0 additions & 207 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /