From d5ba1b3b4834e8c47e0cdf0989f458bc59ab0b45 Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 4 Apr 2025 14:38:07 -0700 Subject: [PATCH 01/26] Use dlerror() when dlopen() fails. --- PythonKit/PythonLibrary.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PythonKit/PythonLibrary.swift b/PythonKit/PythonLibrary.swift index 6149478..ab94a3f 100644 --- a/PythonKit/PythonLibrary.swift +++ b/PythonKit/PythonLibrary.swift @@ -205,6 +205,13 @@ extension PythonLibrary { // Must be RTLD_GLOBAL because subsequent .so files from the imported python // modules may depend on this .so file. let pythonLibraryHandle = dlopen(path, RTLD_LAZY | RTLD_GLOBAL) + if pythonLibraryHandle == nil { + self.log("Failed to load library at '\(path)'.") + if let errorCString = dlerror() { + let errorString = String(cString: errorCString) + self.log("Reason for failure: \(errorString)") + } + } #endif if pythonLibraryHandle != nil { From 04205cdda392c154b1b5837978497c589398dc9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Thu, 11 Sep 2025 12:27:42 +0200 Subject: [PATCH 02/26] Updated project [SKIP-CI] --- AGENTS.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..78ad2c6 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,58 @@ +# Agents + +This file provides critical development and deployment guidelines for AI agents working with this app project. + +## Development + +### Project Structure +- App-specific logic belongs in framework targets. +- **External SwiftPM dependencies** contain shared logic and helper functions. +- UI code should be separated from business logic. +- For app development focus on the **Xcode project**. Package.swift typically supports building CLI tools only. + +### Code Patterns +- Use appropriate logging frameworks instead of print statements. +- Follow protocol-oriented design patterns. +- **CRITICAL: Always check FoundationKit, LoggerKit, SwiftUIKit, and other core frameworks before implementing basic functionality.** These frameworks contain extensive extensions and utilities that avoid code duplication. + +#### Core Frameworks Extensions Examples +- **NSError**: `NSError(description:, recoverySuggestion:)` convenience initializer +- **NSAppleScript**: `execute()` method with proper Swift error handling +- **ProcessInfo**: `launchExtensionsPaneInSystemSettings()`, `launchPrivacyAndSecurityPaneInSystemSettings()` +- **URL**: `open(withAppBundleIdentifier:)` for cross-platform URL opening +- **Process**: Enhanced execution utilities with output capture +- **UserDefaults**: `@UserDefaults.Wrapper` property wrapper for cleaner app preferences + +### Working with External SwiftPM Dependencies +- External dependencies are separate SwiftPM repositories shared across multiple apps. +- Changes to core models, utilities, business rules must be made in their respective packages (typically you can find them in the project parent directory). +- To build or test a SwiftPM project use `DeveloperBuildTool` instead of `swift build`. +- Workflow: Edit external package → Build → Commit & Push → Return to main project → Reload package dependencies → Rebuild. + +### Verification Requirements +- **Always verify changes work** by building or testing before considering task complete. +- Build or test external dependencies if changes were made to them. +- Build main project to ensure all changes integrate properly. +- Run the application when possible to ensure functionality works as expected. Make sure to terminate any running instances of the app before running again. +- Changes are not complete until successfully built and verified. + +### Development Workflow +- All development work is done from the `master` branch. +- By default, feature development, bug fixes, and general improvements happen directly on `master`. +- Optionally, `feature/` or `fix/` branches can be created for parallel work. + +## Deployment + +### Release Process +For app releases: +1. **Version Update**: Update the Xcode project Marketing Version setting and / or the `CFBundleShortVersionString` in all relevant Info.plist files. Use the standard versioning format (eg. `1.0`, then `1.1` or `1.0.1` for minor updates). Ensure the version is consistent across all targets (app, extensions, frameworks). +2. **Commit Changes**: Add, commit, and push all pending changes to `master` branch. +3. **Merge to Release**: Switch to `release` branch, merge from `master`, and push to remote. Note: Only the `release` branch is linked to Xcode Cloud for automated builds. +4. **Tag Release**: After pushing to `release` branch, you MUST ALWAYS create and push a git tag. Use the `v1.0` or `v1.0.1` format for tags and a message like `ProjectName v1.0.1`. Create or replace the new tag and push to remote with force flag. Always use the same version number as the one in the Xcode project, if it did not change, use the same tag as the previous release. +5. **Back to Master**: Switch back to `master` branch for further development. + +**CRITICAL**: Each time you push to the `release` branch make sure to **always** tag it with current project version. This is crucial for maintaining a clear version history. + +--- + +**IMPORTANT**: This is a generic development guide for AI agents shared and available on multiple app projects, so avoid adding project-specific information here. Refer to README.md and the source code for project-specific details. \ No newline at end of file From e847029062dfb9c74c1c7ce1ea091a8989de1b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Thu, 11 Sep 2025 12:31:05 +0200 Subject: [PATCH 03/26] Updated project [SKIP-CI] --- AGENTS.md | 41 +++++------------------------------------ 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 78ad2c6..74aeb02 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,19 +1,13 @@ # Agents -This file provides critical development and deployment guidelines for AI agents working with this app project. +This file provides development guidelines for AI agents working with this Swift Package Manager project. ## Development -### Project Structure -- App-specific logic belongs in framework targets. -- **External SwiftPM dependencies** contain shared logic and helper functions. -- UI code should be separated from business logic. -- For app development focus on the **Xcode project**. Package.swift typically supports building CLI tools only. - ### Code Patterns - Use appropriate logging frameworks instead of print statements. - Follow protocol-oriented design patterns. -- **CRITICAL: Always check FoundationKit, LoggerKit, SwiftUIKit, and other core frameworks before implementing basic functionality.** These frameworks contain extensive extensions and utilities that avoid code duplication. +- **CRITICAL: Always check FoundationKit, LoggerKit, and other core frameworks before implementing basic functionality.** These frameworks contain extensive extensions and utilities that avoid code duplication. #### Core Frameworks Extensions Examples - **NSError**: `NSError(description:, recoverySuggestion:)` convenience initializer @@ -23,36 +17,11 @@ This file provides critical development and deployment guidelines for AI agents - **Process**: Enhanced execution utilities with output capture - **UserDefaults**: `@UserDefaults.Wrapper` property wrapper for cleaner app preferences -### Working with External SwiftPM Dependencies -- External dependencies are separate SwiftPM repositories shared across multiple apps. -- Changes to core models, utilities, business rules must be made in their respective packages (typically you can find them in the project parent directory). -- To build or test a SwiftPM project use `DeveloperBuildTool` instead of `swift build`. -- Workflow: Edit external package → Build → Commit & Push → Return to main project → Reload package dependencies → Rebuild. - -### Verification Requirements +### Building and Testing +- To build or test this SwiftPM project, use `DeveloperBuildTool [--test]` instead of `swift build` or `swift test`. - **Always verify changes work** by building or testing before considering task complete. -- Build or test external dependencies if changes were made to them. -- Build main project to ensure all changes integrate properly. -- Run the application when possible to ensure functionality works as expected. Make sure to terminate any running instances of the app before running again. - Changes are not complete until successfully built and verified. -### Development Workflow -- All development work is done from the `master` branch. -- By default, feature development, bug fixes, and general improvements happen directly on `master`. -- Optionally, `feature/` or `fix/` branches can be created for parallel work. - -## Deployment - -### Release Process -For app releases: -1. **Version Update**: Update the Xcode project Marketing Version setting and / or the `CFBundleShortVersionString` in all relevant Info.plist files. Use the standard versioning format (eg. `1.0`, then `1.1` or `1.0.1` for minor updates). Ensure the version is consistent across all targets (app, extensions, frameworks). -2. **Commit Changes**: Add, commit, and push all pending changes to `master` branch. -3. **Merge to Release**: Switch to `release` branch, merge from `master`, and push to remote. Note: Only the `release` branch is linked to Xcode Cloud for automated builds. -4. **Tag Release**: After pushing to `release` branch, you MUST ALWAYS create and push a git tag. Use the `v1.0` or `v1.0.1` format for tags and a message like `ProjectName v1.0.1`. Create or replace the new tag and push to remote with force flag. Always use the same version number as the one in the Xcode project, if it did not change, use the same tag as the previous release. -5. **Back to Master**: Switch back to `master` branch for further development. - -**CRITICAL**: Each time you push to the `release` branch make sure to **always** tag it with current project version. This is crucial for maintaining a clear version history. - --- -**IMPORTANT**: This is a generic development guide for AI agents shared and available on multiple app projects, so avoid adding project-specific information here. Refer to README.md and the source code for project-specific details. \ No newline at end of file +**IMPORTANT**: This is a generic development guide for AI agents shared and available on multiple projects, so avoid adding project-specific information here. Refer to README.md and the source code for project-specific details. \ No newline at end of file From 253ee2b1f37d5bf18fd8f88fcd1f36e95c2c4fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Thu, 11 Sep 2025 12:38:18 +0200 Subject: [PATCH 04/26] Updated project [SKIP-CI] --- AGENTS.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 74aeb02..364c34b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -5,23 +5,26 @@ This file provides development guidelines for AI agents working with this Swift ## Development ### Code Patterns + - Use appropriate logging frameworks instead of print statements. - Follow protocol-oriented design patterns. -- **CRITICAL: Always check FoundationKit, LoggerKit, and other core frameworks before implementing basic functionality.** These frameworks contain extensive extensions and utilities that avoid code duplication. +- **CRITICAL: If listed on Package.swift, always check FoundationKit, LoggerKit, and other core frameworks before implementing basic functionality.** These frameworks contain extensive extensions and utilities that avoid code duplication (typically you can find them in the project parent directory). #### Core Frameworks Extensions Examples + - **NSError**: `NSError(description:, recoverySuggestion:)` convenience initializer -- **NSAppleScript**: `execute()` method with proper Swift error handling +- **NSAppleScript**: `execute()` method with proper Swift error handling - **ProcessInfo**: `launchExtensionsPaneInSystemSettings()`, `launchPrivacyAndSecurityPaneInSystemSettings()` - **URL**: `open(withAppBundleIdentifier:)` for cross-platform URL opening - **Process**: Enhanced execution utilities with output capture - **UserDefaults**: `@UserDefaults.Wrapper` property wrapper for cleaner app preferences ### Building and Testing -- To build or test this SwiftPM project, use `DeveloperBuildTool [--test]` instead of `swift build` or `swift test`. + +- To build or test this SwiftPM project, use `DeveloperBuildTool [--test]` (if available) instead of `swift build` or `swift test`. - **Always verify changes work** by building or testing before considering task complete. - Changes are not complete until successfully built and verified. --- -**IMPORTANT**: This is a generic development guide for AI agents shared and available on multiple projects, so avoid adding project-specific information here. Refer to README.md and the source code for project-specific details. \ No newline at end of file +**IMPORTANT**: This is a generic development guide for AI agents shared and available on multiple projects, so avoid adding project-specific information here. Refer to README.md and the source code for project-specific details. From 12a4bc8450ab87aae322f24b7d4b1a74243b8cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Thu, 11 Sep 2025 12:47:05 +0200 Subject: [PATCH 05/26] Updated project [SKIP-CI] --- AGENTS.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 364c34b..9289c05 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,20 +8,19 @@ This file provides development guidelines for AI agents working with this Swift - Use appropriate logging frameworks instead of print statements. - Follow protocol-oriented design patterns. -- **CRITICAL: If listed on Package.swift, always check FoundationKit, LoggerKit, and other core frameworks before implementing basic functionality.** These frameworks contain extensive extensions and utilities that avoid code duplication (typically you can find them in the project parent directory). +- **CRITICAL: If they are listed on `Package.swift`, always check `FoundationKit`, `LoggerKit`, and other core frameworks before implementing basic functionality.** These frameworks contain extensive extensions and utilities that avoid code duplication (typically you can find them in the project parent directory). -#### Core Frameworks Extensions Examples +#### Core Frameworks Functionality Examples -- **NSError**: `NSError(description:, recoverySuggestion:)` convenience initializer -- **NSAppleScript**: `execute()` method with proper Swift error handling -- **ProcessInfo**: `launchExtensionsPaneInSystemSettings()`, `launchPrivacyAndSecurityPaneInSystemSettings()` -- **URL**: `open(withAppBundleIdentifier:)` for cross-platform URL opening -- **Process**: Enhanced execution utilities with output capture -- **UserDefaults**: `@UserDefaults.Wrapper` property wrapper for cleaner app preferences +- **NSError**: `NSError(description:, recoverySuggestion:)` convenience initializer. +- **NSAppleScript**: `execute()` method with proper Swift error handling. +- **ProcessInfo**: `launchExtensionsPaneInSystemSettings()`, `launchPrivacyAndSecurityPaneInSystemSettings()`. +- **URL**: `open(withAppBundleIdentifier:)` for cross-platform URL opening. +- **Process**: Enhanced execution utilities with output capture. +- **UserDefaults**: `@UserDefaults.Wrapper` property wrapper for cleaner app preferences. ### Building and Testing -- To build or test this SwiftPM project, use `DeveloperBuildTool [--test]` (if available) instead of `swift build` or `swift test`. - **Always verify changes work** by building or testing before considering task complete. - Changes are not complete until successfully built and verified. From 2728bfb247e9662f492c43be01c7f1976bca5c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Thu, 11 Sep 2025 13:55:19 +0200 Subject: [PATCH 06/26] Updated project [SKIP-CI] --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 9289c05..f5acd14 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,4 +26,4 @@ This file provides development guidelines for AI agents working with this Swift --- -**IMPORTANT**: This is a generic development guide for AI agents shared and available on multiple projects, so avoid adding project-specific information here. Refer to README.md and the source code for project-specific details. +**IMPORTANT**: This is a generic development guide for AI agents shared and available on multiple projects, so avoid adding project-specific information here. Refer to `README.md` file if available and the source code for project-specific details. From d030b5193d1e4e770156deb27865773b64c5695f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Thu, 18 Sep 2025 13:39:27 +0200 Subject: [PATCH 07/26] Updated project [SKIP-CI] --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index f5acd14..8b46202 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -17,7 +17,7 @@ This file provides development guidelines for AI agents working with this Swift - **ProcessInfo**: `launchExtensionsPaneInSystemSettings()`, `launchPrivacyAndSecurityPaneInSystemSettings()`. - **URL**: `open(withAppBundleIdentifier:)` for cross-platform URL opening. - **Process**: Enhanced execution utilities with output capture. -- **UserDefaults**: `@UserDefaults.Wrapper` property wrapper for cleaner app preferences. +- **UserDefaults**: `@UserDefaults.Wrapper` property wrapper for cleaner app settings. ### Building and Testing From 36a9f7f782120d0729733d604aaffc85b164d13b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Thu, 18 Jun 2026 01:35:52 +0200 Subject: [PATCH 08/26] Update README package branch --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 83feb56..4a7fa1e 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ print("Python Encoding: \(sys.getdefaultencoding().upper())") Add the following dependency to your `Package.swift` manifest: ```swift -.package(url: "https://github.com/pvieito/PythonKit.git", branch: "master"), +.package(url: "https://github.com/pvieito/PythonKit.git", branch: "main"), ``` ## Environment Variables From 39f823774c0258b92f8919584b37c89481ebdb9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Thu, 18 Jun 2026 11:17:50 +0200 Subject: [PATCH 09/26] Fix CI Python library selection --- .github/workflows/continuous-integration.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e265347..f6e85c3 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -14,12 +14,17 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v1 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: - python-version: '3.x' + python-version: '3.13' + - name: Configure PythonKit + shell: bash + run: | + python_library="$(find "$pythonLocation" \( -name 'libpython3.13*.dylib' -o -name 'libpython3.13*.so' \) -print -quit)" + test -n "$python_library" + echo "PYTHON_LIBRARY=$python_library" >> "$GITHUB_ENV" - name: Test run: swift test --enable-test-discovery if: runner.os != 'Windows' env: - PYTHON_VERSION: 3 PYTHON_LOADER_LOGGING: TRUE From 4c9e63680ab40aa0cff16bd3464c3c676f6e0c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Thu, 18 Jun 2026 11:19:36 +0200 Subject: [PATCH 10/26] Follow Python toolcache symlinks in CI --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index f6e85c3..5510144 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -20,7 +20,7 @@ jobs: - name: Configure PythonKit shell: bash run: | - python_library="$(find "$pythonLocation" \( -name 'libpython3.13*.dylib' -o -name 'libpython3.13*.so' \) -print -quit)" + python_library="$(find -L "$pythonLocation" \( -name 'libpython3.13*.dylib' -o -name 'libpython3.13*.so' \) -print -quit)" test -n "$python_library" echo "PYTHON_LIBRARY=$python_library" >> "$GITHUB_ENV" - name: Test From 91b0f7fb7ce9c83cfe6665a8194dd10cef51d19e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Fri, 19 Jun 2026 02:03:44 +0200 Subject: [PATCH 11/26] Reduce shared agent instructions --- AGENTS.md | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 8b46202..ad824ff 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,29 +1,10 @@ # Agents -This file provides development guidelines for AI agents working with this Swift Package Manager project. +This project is a Swift Package Manager project. -## Development +For general development guidance, use the `swift-project-guide` skill. -### Code Patterns +## Project Notes -- Use appropriate logging frameworks instead of print statements. -- Follow protocol-oriented design patterns. -- **CRITICAL: If they are listed on `Package.swift`, always check `FoundationKit`, `LoggerKit`, and other core frameworks before implementing basic functionality.** These frameworks contain extensive extensions and utilities that avoid code duplication (typically you can find them in the project parent directory). - -#### Core Frameworks Functionality Examples - -- **NSError**: `NSError(description:, recoverySuggestion:)` convenience initializer. -- **NSAppleScript**: `execute()` method with proper Swift error handling. -- **ProcessInfo**: `launchExtensionsPaneInSystemSettings()`, `launchPrivacyAndSecurityPaneInSystemSettings()`. -- **URL**: `open(withAppBundleIdentifier:)` for cross-platform URL opening. -- **Process**: Enhanced execution utilities with output capture. -- **UserDefaults**: `@UserDefaults.Wrapper` property wrapper for cleaner app settings. - -### Building and Testing - -- **Always verify changes work** by building or testing before considering task complete. -- Changes are not complete until successfully built and verified. - ---- - -**IMPORTANT**: This is a generic development guide for AI agents shared and available on multiple projects, so avoid adding project-specific information here. Refer to `README.md` file if available and the source code for project-specific details. +- Read `README.md` for project-specific architecture, targets, and conventions. +- Keep project-specific guidance in `README.md` or source-local documentation, not in this shared `AGENTS.md`. From 8396f7a62980a66ad2a990d7881175055da67459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Mon, 22 Jun 2026 23:46:06 +0200 Subject: [PATCH 12/26] Restrict CI workflow to main --- .github/workflows/continuous-integration.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 5510144..3823db0 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,8 +1,12 @@ name: Continuous Integration on: - - push - - pull_request + push: + branches: + - main + pull_request: + branches: + - main jobs: continuous-integration: From 94572e93f393d011249f4ce790a974c0238eea0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Thu, 2 Jul 2026 18:35:11 +0200 Subject: [PATCH 13/26] Skip CI for draft PRs [SKIP-CI] --- .github/workflows/continuous-integration.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3823db0..af850f5 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -10,6 +10,10 @@ on: jobs: continuous-integration: + if: > + (github.event_name != 'pull_request' || github.event.pull_request.draft == false) && + !contains(github.event.head_commit.message || '', '[SKIP-CI]') && + !contains(github.event.pull_request.title || '', '[SKIP-CI]') strategy: matrix: os: From 1ac25ddddca845ba0184911de9c00e1508948cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Wed, 8 Jul 2026 13:17:34 +0200 Subject: [PATCH 14/26] Add agent skill symlinks [SKIP-CI] --- .agents/skills | 1 + .claude/skills | 1 + Agents/Instructions/.gitkeep | 0 Agents/Skills/.gitkeep | 0 CLAUDE.md | 1 + 5 files changed, 3 insertions(+) create mode 120000 .agents/skills create mode 120000 .claude/skills create mode 100644 Agents/Instructions/.gitkeep create mode 100644 Agents/Skills/.gitkeep create mode 120000 CLAUDE.md diff --git a/.agents/skills b/.agents/skills new file mode 120000 index 0000000..f0c855e --- /dev/null +++ b/.agents/skills @@ -0,0 +1 @@ +../Agents/Skills \ No newline at end of file diff --git a/.claude/skills b/.claude/skills new file mode 120000 index 0000000..f0c855e --- /dev/null +++ b/.claude/skills @@ -0,0 +1 @@ +../Agents/Skills \ No newline at end of file diff --git a/Agents/Instructions/.gitkeep b/Agents/Instructions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Agents/Skills/.gitkeep b/Agents/Skills/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 0000000..47dc3e3 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file From af828c39e5b1c7061e3016f419608690a9fed128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Thu, 27 Aug 2026 13:30:12 +0200 Subject: [PATCH 15/26] Fix README grammar and formatting [SKIP-CI] --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4a7fa1e..ddefa9a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# PythonKit +# PythonKit [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fpvieito%2FPythonKit%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/pvieito/PythonKit) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fpvieito%2FPythonKit%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/pvieito/PythonKit) @@ -39,7 +39,7 @@ Add the following dependency to your `Package.swift` manifest: ## Environment Variables -As the Python library are loaded at runtime by **PythonKit**, it will try to find the most modern Python version available in the system. You can force a given version with the `PYTHON_VERSION` environment variable or an specific Python library path or name with `PYTHON_LIBRARY`. +As Python libraries are loaded at runtime by **PythonKit**, it will try to find the most modern Python version available in the system. You can force a given version with the `PYTHON_VERSION` environment variable or a specific Python library path or name with `PYTHON_LIBRARY`. ``` $ PYTHON_VERSION=3 swift run @@ -64,7 +64,7 @@ Fatal error: Python library not found. Set the PYTHON_LIBRARY environment variab ## Troubleshooting -- If your are targeting the Mac platform with the [Hardened Runtime](https://developer.apple.com/documentation/security/hardened_runtime) enabled make sure you are properly signing and embedding the Python framework you are trying to load with **PythonKit**. The Hardened Runtime [Library Validation mechanism](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-library-validation) prevents a process from loading libraries that are not signed by Apple or the same developer as the main process. +- If you are targeting the Mac platform with the [Hardened Runtime](https://developer.apple.com/documentation/security/hardened_runtime) enabled, make sure you are properly signing and embedding the Python framework you are trying to load with **PythonKit**. The Hardened Runtime [Library Validation mechanism](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-library-validation) prevents a process from loading libraries that are not signed by Apple or the same developer as the main process. ## Notes From 71cf18aed89cdb2790f916082c5cd4e222b173d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Thu, 27 Aug 2026 16:44:43 +0200 Subject: [PATCH 16/26] Polish README grammar and code blocks [SKIP-CI] --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ddefa9a..a9cc22c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ - # PythonKit + [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fpvieito%2FPythonKit%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/pvieito/PythonKit) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fpvieito%2FPythonKit%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/pvieito/PythonKit) @@ -17,7 +17,7 @@ print(f"Python Version: {sys.version}") print(f"Python Encoding: {sys.getdefaultencoding().upper()}") ``` -Can be implemented in Swift through PythonKit with the following code: +The same code can be implemented in Swift through PythonKit: ```swift import PythonKit @@ -41,7 +41,7 @@ Add the following dependency to your `Package.swift` manifest: As Python libraries are loaded at runtime by **PythonKit**, it will try to find the most modern Python version available in the system. You can force a given version with the `PYTHON_VERSION` environment variable or a specific Python library path or name with `PYTHON_LIBRARY`. -``` +```console $ PYTHON_VERSION=3 swift run [*] Python 3.5 $ PYTHON_VERSION=2.7 swift run @@ -54,7 +54,7 @@ $ PYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython2.7.so swift run If **PythonKit** cannot find and load the Python library you can set the `PYTHON_LOADER_LOGGING` environment variable to know from which locations **PythonKit** is trying to load the library: -``` +```console $ PYTHON_LOADER_LOGGING=TRUE PYTHON_VERSION=3.8 swift run Loading symbol 'Py_Initialize' from the Python library... Trying to load library at 'Python.framework/Versions/3.8/Python'... @@ -66,7 +66,6 @@ Fatal error: Python library not found. Set the PYTHON_LIBRARY environment variab - If you are targeting the Mac platform with the [Hardened Runtime](https://developer.apple.com/documentation/security/hardened_runtime) enabled, make sure you are properly signing and embedding the Python framework you are trying to load with **PythonKit**. The Hardened Runtime [Library Validation mechanism](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-library-validation) prevents a process from loading libraries that are not signed by Apple or the same developer as the main process. - ## Notes - Originally **PythonKit** was based on the `Python` module from the [**Swift for TensorFlow**](https://github.com/tensorflow/swift) experimental project. From ee6cb825d43c33dd84c1462563ca60d9e4dfb0f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Mon, 7 Sep 2026 20:19:06 +0200 Subject: [PATCH 17/26] Align Swift tools and deployment requirements [SKIP-CI] --- .github/workflows/continuous-integration.yml | 21 +++++++++++++++++--- Package.swift | 12 ++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index af850f5..dc23b53 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -16,11 +16,26 @@ jobs: !contains(github.event.pull_request.title || '', '[SKIP-CI]') strategy: matrix: - os: - - ubuntu-latest - - macos-latest + include: + - os: ubuntu-24.04 + - os: macos-26 + xcode: "26.0.1" + - os: macos-26 + xcode: latest-stable runs-on: ${{ matrix.os }} steps: + - name: Set Up Swift + if: runner.os == 'Linux' + uses: swift-actions/setup-swift@v2 + with: + swift-version: "6.2" + - name: Select Xcode + if: runner.os == 'macOS' + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: ${{ matrix.xcode }} + - name: Show Swift Version + run: swift --version - uses: actions/checkout@v1 - uses: actions/setup-python@v6 with: diff --git a/Package.swift b/Package.swift index c1ea0aa..5f17acc 100644 --- a/Package.swift +++ b/Package.swift @@ -1,9 +1,12 @@ -// swift-tools-version:5.1 +// swift-tools-version:6.2 import PackageDescription let package = Package( name: "PythonKit", + platforms: [ + .macOS(.v26), + ], products: [ .library( name: "PythonKit", @@ -17,7 +20,10 @@ let package = Package( ), .testTarget( name: "PythonKitTests", - dependencies: ["PythonKit"] + dependencies: [ + "PythonKit", + ] ), - ] + ], + swiftLanguageModes: [.v5] ) From 405f70283fdf4ee516b28081a3c7da2ae0987be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Tue, 8 Sep 2026 20:06:54 +0200 Subject: [PATCH 18/26] Restore latest GitHub Actions runners [SKIP-CI] --- .github/workflows/continuous-integration.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index dc23b53..10c44db 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -17,10 +17,10 @@ jobs: strategy: matrix: include: - - os: ubuntu-24.04 - - os: macos-26 + - os: ubuntu-latest + - os: macos-latest xcode: "26.0.1" - - os: macos-26 + - os: macos-latest xcode: latest-stable runs-on: ${{ matrix.os }} steps: From 244737f933ad20178412c0b17fd163ba3b3dad43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Tue, 8 Sep 2026 20:11:16 +0200 Subject: [PATCH 19/26] Restore simple operating-system CI matrix [SKIP-CI] --- .github/workflows/continuous-integration.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 10c44db..2db337b 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -16,12 +16,9 @@ jobs: !contains(github.event.pull_request.title || '', '[SKIP-CI]') strategy: matrix: - include: - - os: ubuntu-latest - - os: macos-latest - xcode: "26.0.1" - - os: macos-latest - xcode: latest-stable + os: + - ubuntu-latest + - macos-latest runs-on: ${{ matrix.os }} steps: - name: Set Up Swift @@ -29,11 +26,6 @@ jobs: uses: swift-actions/setup-swift@v2 with: swift-version: "6.2" - - name: Select Xcode - if: runner.os == 'macOS' - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: ${{ matrix.xcode }} - name: Show Swift Version run: swift --version - uses: actions/checkout@v1 From 3535165034a1f05be5b1f2355a5b6e9a63d95bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jos=C3=A9=20Pereira=20Vieito?= Date: Wed, 9 Sep 2026 01:25:34 +0200 Subject: [PATCH 20/26] Update Package.swift --- Package.swift | 3 --- 1 file changed, 3 deletions(-) diff --git a/Package.swift b/Package.swift index 5f17acc..2a87b41 100644 --- a/Package.swift +++ b/Package.swift @@ -4,9 +4,6 @@ import PackageDescription let package = Package( name: "PythonKit", - platforms: [ - .macOS(.v26), - ], products: [ .library( name: "PythonKit", From 690d18f3f4f5ac13e5a4b24d4e0fce8e592d145c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jos=C3=A9=20Pereira=20Vieito?= Date: Wed, 9 Sep 2026 01:26:22 +0200 Subject: [PATCH 21/26] Update Swift tools version to 6.0 --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 2a87b41..2f5b7f0 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription From a5b6fae118c113ee554209559abe089d96155e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Wed, 9 Sep 2026 19:26:40 +0200 Subject: [PATCH 22/26] Add public project marker [SKIP-CI] --- .public_project | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .public_project diff --git a/.public_project b/.public_project new file mode 100644 index 0000000..e69de29 From c25790da853916dac6039e58efd5db1f2d01858c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Wed, 9 Sep 2026 21:06:03 +0200 Subject: [PATCH 23/26] AGENTS update [SKIP-CI] --- AGENTS.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index ad824ff..2538ff9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,10 +1,16 @@ # Agents -This project is a Swift Package Manager project. - -For general development guidance, use the `swift-project-guide` skill. +This is an open-source Swift package with a public API. ## Project Notes - Read `README.md` for project-specific architecture, targets, and conventions. -- Keep project-specific guidance in `README.md` or source-local documentation, not in this shared `AGENTS.md`. +- Keep project-specific guidance in `README.md` or source-local documentation, not in `AGENTS.md`. + +## Public Repository + +**IMPORTANT**: This is a public repository. Do not add internal or confidential information, including private project names, internal consumers, local paths, credentials, or content from private repositories or conversations. Use public, self-contained examples and dependencies. + +## Public API + +Modify this repository with extra care. Preserve its public APIs, behavior, supported platforms, toolchain requirements, and stable URLs. Do not introduce breaking changes without a detailed compatibility review and explicit authorization. Review source, tests, documentation, generated files, agent instructions, and commit or pull-request text for information disclosure before publishing. From 27d59187de6722c5011acc3cb319a6e5e31bb815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Fri, 11 Sep 2026 13:34:35 +0200 Subject: [PATCH 24/26] Project update [SKIP-CI] --- .open_source | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .open_source diff --git a/.open_source b/.open_source new file mode 100644 index 0000000..e69de29 From e1d34f95c58189b771bfc8423b9b2cf8fc651664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Fri, 11 Sep 2026 13:37:19 +0200 Subject: [PATCH 25/26] PythonKit v1.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a9cc22c..8174faa 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ print("Python Encoding: \(sys.getdefaultencoding().upper())") Add the following dependency to your `Package.swift` manifest: ```swift -.package(url: "https://github.com/pvieito/PythonKit.git", branch: "main"), +.package(url: "https://github.com/pvieito/PythonKit.git", from: "1.0.0"), ``` ## Environment Variables From fe7d97334600b0fc11fbef5e0525f93eaa68ef7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Jose=CC=81=20Pereira=20Vieito?= Date: Fri, 23 Oct 2026 10:35:46 +0200 Subject: [PATCH 26/26] Use preinstalled runner Swift on Linux CI --- .github/workflows/continuous-integration.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 2db337b..a05389d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -21,11 +21,6 @@ jobs: - macos-latest runs-on: ${{ matrix.os }} steps: - - name: Set Up Swift - if: runner.os == 'Linux' - uses: swift-actions/setup-swift@v2 - with: - swift-version: "6.2" - name: Show Swift Version run: swift --version - uses: actions/checkout@v1 @@ -39,7 +34,6 @@ jobs: test -n "$python_library" echo "PYTHON_LIBRARY=$python_library" >> "$GITHUB_ENV" - name: Test - run: swift test --enable-test-discovery - if: runner.os != 'Windows' + run: swift test env: PYTHON_LOADER_LOGGING: TRUE