Skip to content

Eric/cus 9 support cli updates #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ jobs:
PREVIEW_VERSION="${BASE_VERSION}.dev${{ github.event.pull_request.number }}${{ github.event.pull_request.commits }}"
echo "VERSION=${PREVIEW_VERSION}" >> $GITHUB_ENV
# Update version in __init__.py
echo "__version__ = \"${PREVIEW_VERSION}\"" > socketdev/__init__.py.tmp
cat socketdev/__init__.py | grep -v "__version__" >> socketdev/__init__.py.tmp
mv socketdev/__init__.py.tmp socketdev/__init__.py
# Update version in version.py instead of __init__.py
echo "__version__ = \"${PREVIEW_VERSION}\"" > socketdev/version.py
# Verify the change
echo "Updated version in __init__.py:"
cat socketdev/__init__.py | grep "__version__"
echo "Updated version in version.py:"
cat socketdev/version.py
- name: Check if version exists on Test PyPI
id: version_check
Expand All @@ -55,9 +53,7 @@ jobs:
if: always()
run: |
BASE_VERSION=$(echo $VERSION | cut -d'.' -f1-3)
echo "__version__ = \"${BASE_VERSION}\"" > socketdev/__init__.py.tmp
cat socketdev/__init__.py | grep -v "__version__" >> socketdev/__init__.py.tmp
mv socketdev/__init__.py.tmp socketdev/__init__.py
echo "__version__ = \"${BASE_VERSION}\"" > socketdev/version.py
- name: Publish to Test PyPI
if: steps.version_check.outputs.exists != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Get Version
id: version
run: |
RAW_VERSION=$(python -c "from socketdev import __version__; print(__version__)")
RAW_VERSION=$(python -c "from socketdev.version import __version__; print(__version__)")
echo "VERSION=$RAW_VERSION" >> $GITHUB_ENV
if [ "v$RAW_VERSION" != "${{ github.ref_name }}" ]; then
echo "Error: Git tag (${{ github.ref_name }}) does not match package version (v$RAW_VERSION)"
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@ jobs:
id: version_check
run: |
# Get version from current PR
PR_VERSION=$(grep -o '__version__ = "[^"]*"' socketdev/__init__.py | cut -d'"' -f2)
PR_VERSION=$(grep -o '__version__ = "[^"]*"' socketdev/version.py | cut -d'"' -f2)
echo "Debug PR version: $PR_VERSION"
echo "PR_VERSION=${PR_VERSION}" >> $GITHUB_ENV

# Get version from main branch
# Get version from main branch - try both locations
git checkout origin/main
MAIN_VERSION=$(grep -o '__version__ = "[^"]*"' socketdev/__init__.py | cut -d'"' -f2)
if [ -f socketdev/version.py ]; then
MAIN_VERSION=$(grep -o '__version__ = "[^"]*"' socketdev/version.py | cut -d'"' -f2)
else
# Fall back to old location in __init__.py
# Use more specific grep to avoid matching the imported version
MAIN_VERSION=$(grep -o '^__version__ = "[^"]*"' socketdev/__init__.py | cut -d'"' -f2)
fi

echo "Debug main version: $MAIN_VERSION"
echo "MAIN_VERSION=${MAIN_VERSION}" >> $GITHUB_ENV

Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12.7
15 changes: 0 additions & 15 deletions Pipfile

This file was deleted.

472 changes: 0 additions & 472 deletions Pipfile.lock

This file was deleted.

14 changes: 11 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
[build-system]
requires = ["setuptools >= 61.0"]
requires = [
"setuptools >= 61.0",
"requests"
]
build-backend = "setuptools.build_meta"

[project]
name = "socket-sdk-python"
dynamic = ["version"]
requires-python = ">= 3.9"
dependencies = [
'requests'
'requests',
'typing-extensions>=4.12.2'
]
readme = "README.rst"
license = {file = "LICENSE"}
Expand All @@ -34,6 +38,9 @@ classifiers = [
[project.optional-dependencies]
dev = [
"ruff>=0.3.0",
"twine",
"wheel",
"build",
]

[project.urls]
Expand All @@ -57,10 +64,11 @@ include = [
"socketdev.sbom",
"socketdev.settings",
"socketdev.tools",
"socketdev.utils",
]

[tool.setuptools.dynamic]
version = {attr = "socketdev.__version__"}
version = {attr = "socketdev.version.__version__"}

[tool.ruff]
# Exclude a variety of commonly ignored directories.
Expand Down
72 changes: 72 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: true
# with-sources: false
# generate-hashes: false
# universal: false

-e file:.
build==1.2.2.post1
# via socket-sdk-python
certifi==2024.12.14
# via requests
charset-normalizer==3.4.1
# via requests
docutils==0.21.2
# via readme-renderer
idna==3.10
# via requests
jaraco-classes==3.4.0
# via keyring
jaraco-context==6.0.1
# via keyring
jaraco-functools==4.1.0
# via keyring
keyring==25.6.0
# via twine
markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
more-itertools==10.6.0
# via jaraco-classes
# via jaraco-functools
nh3==0.2.20
# via readme-renderer
packaging==24.2
# via build
# via twine
pkginfo==1.12.0
# via twine
pygments==2.19.1
# via readme-renderer
# via rich
pyproject-hooks==1.2.0
# via build
readme-renderer==44.0
# via twine
requests==2.32.3
# via requests-toolbelt
# via socket-sdk-python
# via twine
requests-toolbelt==1.0.0
# via twine
rfc3986==2.0.0
# via twine
rich==13.9.4
# via twine
ruff==0.9.1
# via socket-sdk-python
twine==6.0.1
# via socket-sdk-python
typing-extensions==4.12.2
# via socket-sdk-python
urllib3==2.3.0
# via requests
# via twine
wheel==0.45.1
# via socket-sdk-python
72 changes: 72 additions & 0 deletions requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: true
# with-sources: false
# generate-hashes: false
# universal: false

-e file:.
build==1.2.2.post1
# via socket-sdk-python
certifi==2024.12.14
# via requests
charset-normalizer==3.4.1
# via requests
docutils==0.21.2
# via readme-renderer
idna==3.10
# via requests
jaraco-classes==3.4.0
# via keyring
jaraco-context==6.0.1
# via keyring
jaraco-functools==4.1.0
# via keyring
keyring==25.6.0
# via twine
markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
more-itertools==10.6.0
# via jaraco-classes
# via jaraco-functools
nh3==0.2.20
# via readme-renderer
packaging==24.2
# via build
# via twine
pkginfo==1.12.0
# via twine
pygments==2.19.1
# via readme-renderer
# via rich
pyproject-hooks==1.2.0
# via build
readme-renderer==44.0
# via twine
requests==2.32.3
# via requests-toolbelt
# via socket-sdk-python
# via twine
requests-toolbelt==1.0.0
# via twine
rfc3986==2.0.0
# via twine
rich==13.9.4
# via twine
ruff==0.9.1
# via socket-sdk-python
twine==6.0.1
# via socket-sdk-python
typing-extensions==4.12.2
# via socket-sdk-python
urllib3==2.3.0
# via requests
# via twine
wheel==0.45.1
# via socket-sdk-python
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

VERSION=$(grep -o "__version__.*" socketdev/__init__.py | awk '{print $3}' | sed 's/"//g' | sed "s/'//g" | tr -d '\r')
VERSION=$(grep -o "__version__.*" socketdev/version.py | awk '{print $3}' | sed 's/"//g' | sed "s/'//g" | tr -d '\r')
ENABLE_PYPI_BUILD=$1

if [ -z $ENABLE_PYPI_BUILD ]; then
Expand Down
Loading
Loading