Skip to content
This repository was archived by the owner on Apr 21, 2023. It is now read-only.

Commit 074622c

Browse files
committedFeb 4, 2021
[PythonKit] Removed PythonTool target and external dependency
1 parent 260ae70 commit 074622c

File tree

5 files changed

+3
-148
lines changed

5 files changed

+3
-148
lines changed
 

‎Package.swift

-13
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,12 @@ import PackageDescription
55
let package = Package(
66
name: "PythonKit",
77
products: [
8-
.executable(
9-
name: "PythonTool",
10-
targets: ["PythonTool"]
11-
),
128
.library(
139
name: "PythonKit",
1410
targets: ["PythonKit"]
1511
)
1612
],
17-
dependencies: [
18-
.package(url: "https://github.com/pvieito/LoggerKit.git", .branch("master")),
19-
.package(url: "https://github.com/apple/swift-argument-parser", .branch("main")),
20-
],
2113
targets: [
22-
.target(
23-
name: "PythonTool",
24-
dependencies: ["LoggerKit", "PythonKit", .product(name: "ArgumentParser", package: "swift-argument-parser")],
25-
path: "PythonTool"
26-
),
2714
.target(
2815
name: "PythonKit",
2916
path: "PythonKit"

‎PythonTool/Info.plist

-14
This file was deleted.

‎PythonTool/OperatingSystemVersion.swift

-20
This file was deleted.

‎PythonTool/main.swift

-85
This file was deleted.

‎README.md

+3-16
Original file line numberDiff line numberDiff line change
@@ -38,38 +38,25 @@ Add the following dependency to your `Package.swift` manifest:
3838
.package(url: "https://github.com/pvieito/PythonKit.git", .branch("master")),
3939
```
4040

41-
## Build & Run
41+
## Environment Variables
4242

43-
`PythonKit` can be built with Swift PM:
44-
45-
```
46-
$ cd PythonKit
47-
$ swift run
48-
[*] Python 3.7
49-
[ ] Version: 3.7.0
50-
```
51-
52-
The Python library will be loaded at runtime, `PythonKit` 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`.
43+
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`.
5344

5445
```
5546
$ PYTHON_VERSION=3 swift run
5647
[*] Python 3.5
57-
[ ] Version: 3.5.2
5848
$ PYTHON_VERSION=2.7 swift run
5949
[*] Python 2.7
60-
[ ] Version: 2.7.10
6150
$ PYTHON_LIBRARY=libpython3.5.so swift run
6251
[*] Python 3.5
63-
[ ] Version: 3.5.2
6452
$ PYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython2.7.so swift run
6553
[*] Python 2.7
66-
[ ] Version: 2.7.10
6754
```
6855

6956
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:
7057

7158
```
72-
$ PYTHON_LOADER_LOGGING=TRUE PYTHON_VERSION=3.8 PythonTool
59+
$ PYTHON_LOADER_LOGGING=TRUE PYTHON_VERSION=3.8 swift run
7360
Loading symbol 'Py_Initialize' from the Python library...
7461
Trying to load library at 'Python.framework/Versions/3.8/Python'...
7562
Trying to load library at '/usr/local/Frameworks/Python.framework/Versions/3.8/Python'...

0 commit comments

Comments
 (0)
This repository has been archived.