Skip to content

Fixed the ability to override the API URL for Socket Requests #64

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 27 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4d0e3c3
Fixed the ability to override the API URL for Socket Requests
dacoburn Mar 25, 2025
44298a2
Changed over to hatchling for releases
dacoburn Mar 31, 2025
74712ea
Updated release workflows for hatchling build
dacoburn Apr 1, 2025
a406371
Adding needed modules for build
dacoburn Apr 1, 2025
1097255
Added pre-commit hook to sync tag to version in file
dacoburn Apr 1, 2025
c0b1b6b
Fixing pr-release for hatch logic
dacoburn Apr 1, 2025
56e3c6d
Bumping version for deploy
dacoburn Apr 1, 2025
2e4d1f5
Fixing build process
dacoburn Apr 1, 2025
d5c3f21
Change build process for PR build
dacoburn Apr 1, 2025
30e8223
Added permissions for Trusted Publishing
dacoburn Apr 1, 2025
85a9cd2
Fixed typo in preview logic
dacoburn Apr 1, 2025
6882053
Removing unneeded command breaking build
dacoburn Apr 1, 2025
a8ac605
Add debug for build process
dacoburn Apr 1, 2025
75437f8
Bump version
dacoburn Apr 1, 2025
dafe836
Added workaround for naming bug when pushing via OIDC
dacoburn Apr 1, 2025
00293c5
Moving to static version and pre commit hook to fix version publishin…
dacoburn Apr 1, 2025
048d421
Adding back in auto increment of version
dacoburn Apr 1, 2025
c787e11
testing version bump
dacoburn Apr 1, 2025
783001b
Updating version logic
dacoburn Apr 1, 2025
50dd663
Updated pre-commit hook
dacoburn Apr 1, 2025
d841ded
version bumped
dacoburn Apr 1, 2025
c05bf3c
Version bump
dacoburn Apr 1, 2025
294742c
Version bump
dacoburn Apr 1, 2025
913d512
Version bump
dacoburn Apr 1, 2025
5b6b4c6
Version bump
dacoburn Apr 1, 2025
e10dc13
Version bump
dacoburn Apr 1, 2025
533b695
Version bump
dacoburn Apr 1, 2025
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
Prev Previous commit
Next Next commit
Added workaround for naming bug when pushing via OIDC
  • Loading branch information
dacoburn committed Apr 1, 2025
commit dafe8369e65c817f70138e07595036a63f11e71a
2 changes: 1 addition & 1 deletion .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Get Hatch version
id: version
run: |
VERSION=$(hatch version)
VERSION=$(hatch version | cut -d+ -f1)
echo "VERSION=$VERSION" >> $GITHUB_ENV

- name: Check if version exists on Test PyPI
Expand Down
14 changes: 6 additions & 8 deletions .hooks/sync_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
PACKAGE_FILE = pathlib.Path("socketsecurity/__init__.py")
VERSION_PATTERN = re.compile(r"__version__\s*=\s*['\"]([^'\"]+)['\"]")

def get_hatch_version(full=False):
raw = subprocess.check_output(["hatch", "version"], text=True).strip()
if full:
return raw
return raw.split(".dev")[0].split("+")[0] # Just base version
def get_hatch_version(full=False, strip_local=False):
version = subprocess.check_output(["hatch", "version"], text=True).strip()
if not full or strip_local:
version = version.split("+")[0] # strip local metadata
return version

def get_current_version():
content = PACKAGE_FILE.read_text()
Expand All @@ -25,7 +25,7 @@ def update_version(new_version):

def main():
full_mode = "--dev" in sys.argv
hatch_version = get_hatch_version(full=full_mode)
hatch_version = get_hatch_version(full=full_mode, strip_local=full_mode)
current_version = get_current_version()

if not current_version:
Expand All @@ -35,8 +35,6 @@ def main():
if hatch_version != current_version:
print(f"🔁 Updating version: {current_version} → {hatch_version}")
update_version(hatch_version)

# In --dev mode, we don't fail — we expect this to update it
return 0 if full_mode else 1

print(f"✅ Version is in sync: {hatch_version}")
Expand Down
2 changes: 1 addition & 1 deletion socketsecurity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__author__ = 'socket.dev'
__version__ = '2.0.24'
__version__ = '2.0.25'
Loading