File tree 27 files changed +1335
-829
lines changed
27 files changed +1335
-829
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,12 @@ jobs:
23
23
PREVIEW_VERSION="${BASE_VERSION}.dev${{ github.event.pull_request.number }}${{ github.event.pull_request.commits }}"
24
24
echo "VERSION=${PREVIEW_VERSION}" >> $GITHUB_ENV
25
25
26
- # Update version in __init__.py
27
- echo "__version__ = \"${PREVIEW_VERSION}\"" > socketdev/__init__.py.tmp
28
- cat socketdev/__init__.py | grep -v "__version__" >> socketdev/__init__.py.tmp
29
- mv socketdev/__init__.py.tmp socketdev/__init__.py
26
+ # Update version in version.py instead of __init__.py
27
+ echo "__version__ = \"${PREVIEW_VERSION}\"" > socketdev/version.py
30
28
31
29
# Verify the change
32
- echo "Updated version in __init__ .py:"
33
- cat socketdev/__init__ .py | grep "__version__"
30
+ echo "Updated version in version .py:"
31
+ cat socketdev/version .py
34
32
35
33
- name : Check if version exists on Test PyPI
36
34
id : version_check
55
53
if : always()
56
54
run : |
57
55
BASE_VERSION=$(echo $VERSION | cut -d'.' -f1-3)
58
- echo "__version__ = \"${BASE_VERSION}\"" > socketdev/__init__.py.tmp
59
- cat socketdev/__init__.py | grep -v "__version__" >> socketdev/__init__.py.tmp
60
- mv socketdev/__init__.py.tmp socketdev/__init__.py
56
+ echo "__version__ = \"${BASE_VERSION}\"" > socketdev/version.py
61
57
62
58
- name : Publish to Test PyPI
63
59
if : steps.version_check.outputs.exists != 'true'
Original file line number Diff line number Diff line change 16
16
- name : Get Version
17
17
id : version
18
18
run : |
19
- RAW_VERSION=$(python -c "from socketdev import __version__; print(__version__)")
19
+ RAW_VERSION=$(python -c "from socketdev.version import __version__; print(__version__)")
20
20
echo "VERSION=$RAW_VERSION" >> $GITHUB_ENV
21
21
if [ "v$RAW_VERSION" != "${{ github.ref_name }}" ]; then
22
22
echo "Error: Git tag (${{ github.ref_name }}) does not match package version (v$RAW_VERSION)"
Original file line number Diff line number Diff line change @@ -19,13 +19,20 @@ jobs:
19
19
id : version_check
20
20
run : |
21
21
# Get version from current PR
22
- PR_VERSION=$(grep -o '__version__ = "[^"]*"' socketdev/__init__ .py | cut -d'"' -f2)
22
+ PR_VERSION=$(grep -o '__version__ = "[^"]*"' socketdev/version .py | cut -d'"' -f2)
23
23
echo "Debug PR version: $PR_VERSION"
24
24
echo "PR_VERSION=${PR_VERSION}" >> $GITHUB_ENV
25
25
26
- # Get version from main branch
26
+ # Get version from main branch - try both locations
27
27
git checkout origin/main
28
- MAIN_VERSION=$(grep -o '__version__ = "[^"]*"' socketdev/__init__.py | cut -d'"' -f2)
28
+ if [ -f socketdev/version.py ]; then
29
+ MAIN_VERSION=$(grep -o '__version__ = "[^"]*"' socketdev/version.py | cut -d'"' -f2)
30
+ else
31
+ # Fall back to old location in __init__.py
32
+ # Use more specific grep to avoid matching the imported version
33
+ MAIN_VERSION=$(grep -o '^__version__ = "[^"]*"' socketdev/__init__.py | cut -d'"' -f2)
34
+ fi
35
+
29
36
echo "Debug main version: $MAIN_VERSION"
30
37
echo "MAIN_VERSION=${MAIN_VERSION}" >> $GITHUB_ENV
31
38
Original file line number Diff line number Diff line change
1
+ 3.12.7
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
[build-system ]
2
- requires = [" setuptools >= 61.0" ]
2
+ requires = [
3
+ " setuptools >= 61.0" ,
4
+ " requests"
5
+ ]
3
6
build-backend = " setuptools.build_meta"
4
7
5
8
[project ]
6
9
name = " socket-sdk-python"
7
10
dynamic = [" version" ]
8
11
requires-python = " >= 3.9"
9
12
dependencies = [
10
- ' requests'
13
+ ' requests' ,
14
+ ' typing-extensions>=4.12.2'
11
15
]
12
16
readme = " README.rst"
13
17
license = {file = " LICENSE" }
@@ -34,6 +38,9 @@ classifiers = [
34
38
[project .optional-dependencies ]
35
39
dev = [
36
40
" ruff>=0.3.0" ,
41
+ " twine" ,
42
+ " wheel" ,
43
+ " build" ,
37
44
]
38
45
39
46
[project .urls ]
@@ -57,10 +64,11 @@ include = [
57
64
" socketdev.sbom" ,
58
65
" socketdev.settings" ,
59
66
" socketdev.tools" ,
67
+ " socketdev.utils" ,
60
68
]
61
69
62
70
[tool .setuptools .dynamic ]
63
- version = {attr = " socketdev.__version__" }
71
+ version = {attr = " socketdev.version. __version__" }
64
72
65
73
[tool .ruff ]
66
74
# Exclude a variety of commonly ignored directories.
Original file line number Diff line number Diff line change
1
+ # generated by rye
2
+ # use `rye lock` or `rye sync` to update this lockfile
3
+ #
4
+ # last locked with the following flags:
5
+ # pre: false
6
+ # features: []
7
+ # all-features: true
8
+ # with-sources: false
9
+ # generate-hashes: false
10
+ # universal: false
11
+
12
+ -e file:.
13
+ build==1.2.2.post1
14
+ # via socket-sdk-python
15
+ certifi==2024.12.14
16
+ # via requests
17
+ charset-normalizer==3.4.1
18
+ # via requests
19
+ docutils==0.21.2
20
+ # via readme-renderer
21
+ idna==3.10
22
+ # via requests
23
+ jaraco-classes==3.4.0
24
+ # via keyring
25
+ jaraco-context==6.0.1
26
+ # via keyring
27
+ jaraco-functools==4.1.0
28
+ # via keyring
29
+ keyring==25.6.0
30
+ # via twine
31
+ markdown-it-py==3.0.0
32
+ # via rich
33
+ mdurl==0.1.2
34
+ # via markdown-it-py
35
+ more-itertools==10.6.0
36
+ # via jaraco-classes
37
+ # via jaraco-functools
38
+ nh3==0.2.20
39
+ # via readme-renderer
40
+ packaging==24.2
41
+ # via build
42
+ # via twine
43
+ pkginfo==1.12.0
44
+ # via twine
45
+ pygments==2.19.1
46
+ # via readme-renderer
47
+ # via rich
48
+ pyproject-hooks==1.2.0
49
+ # via build
50
+ readme-renderer==44.0
51
+ # via twine
52
+ requests==2.32.3
53
+ # via requests-toolbelt
54
+ # via socket-sdk-python
55
+ # via twine
56
+ requests-toolbelt==1.0.0
57
+ # via twine
58
+ rfc3986==2.0.0
59
+ # via twine
60
+ rich==13.9.4
61
+ # via twine
62
+ ruff==0.9.1
63
+ # via socket-sdk-python
64
+ twine==6.0.1
65
+ # via socket-sdk-python
66
+ typing-extensions==4.12.2
67
+ # via socket-sdk-python
68
+ urllib3==2.3.0
69
+ # via requests
70
+ # via twine
71
+ wheel==0.45.1
72
+ # via socket-sdk-python
Original file line number Diff line number Diff line change
1
+ # generated by rye
2
+ # use `rye lock` or `rye sync` to update this lockfile
3
+ #
4
+ # last locked with the following flags:
5
+ # pre: false
6
+ # features: []
7
+ # all-features: true
8
+ # with-sources: false
9
+ # generate-hashes: false
10
+ # universal: false
11
+
12
+ -e file:.
13
+ build==1.2.2.post1
14
+ # via socket-sdk-python
15
+ certifi==2024.12.14
16
+ # via requests
17
+ charset-normalizer==3.4.1
18
+ # via requests
19
+ docutils==0.21.2
20
+ # via readme-renderer
21
+ idna==3.10
22
+ # via requests
23
+ jaraco-classes==3.4.0
24
+ # via keyring
25
+ jaraco-context==6.0.1
26
+ # via keyring
27
+ jaraco-functools==4.1.0
28
+ # via keyring
29
+ keyring==25.6.0
30
+ # via twine
31
+ markdown-it-py==3.0.0
32
+ # via rich
33
+ mdurl==0.1.2
34
+ # via markdown-it-py
35
+ more-itertools==10.6.0
36
+ # via jaraco-classes
37
+ # via jaraco-functools
38
+ nh3==0.2.20
39
+ # via readme-renderer
40
+ packaging==24.2
41
+ # via build
42
+ # via twine
43
+ pkginfo==1.12.0
44
+ # via twine
45
+ pygments==2.19.1
46
+ # via readme-renderer
47
+ # via rich
48
+ pyproject-hooks==1.2.0
49
+ # via build
50
+ readme-renderer==44.0
51
+ # via twine
52
+ requests==2.32.3
53
+ # via requests-toolbelt
54
+ # via socket-sdk-python
55
+ # via twine
56
+ requests-toolbelt==1.0.0
57
+ # via twine
58
+ rfc3986==2.0.0
59
+ # via twine
60
+ rich==13.9.4
61
+ # via twine
62
+ ruff==0.9.1
63
+ # via socket-sdk-python
64
+ twine==6.0.1
65
+ # via socket-sdk-python
66
+ typing-extensions==4.12.2
67
+ # via socket-sdk-python
68
+ urllib3==2.3.0
69
+ # via requests
70
+ # via twine
71
+ wheel==0.45.1
72
+ # via socket-sdk-python
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- VERSION=$( grep -o " __version__.*" socketdev/__init__ .py | awk ' {print $3}' | sed ' s/"//g' | sed " s/'//g" | tr -d ' \r' )
3
+ VERSION=$( grep -o " __version__.*" socketdev/version .py | awk ' {print $3}' | sed ' s/"//g' | sed " s/'//g" | tr -d ' \r' )
4
4
ENABLE_PYPI_BUILD=$1
5
5
6
6
if [ -z $ENABLE_PYPI_BUILD ]; then
You can’t perform that action at this time.
0 commit comments