You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,20 +98,28 @@ my-project
98
98
99
99
## Python metadata
100
100
101
+
To specifiy python dependecies, add a list `requires-dist` in a `[package.metadata.pyo3-pack]` section in the Cargo.toml. This list is equivalent to `install_requires` in setuptools:
102
+
103
+
```toml
104
+
[package.metadata.pyo3-pack]
105
+
requires-dist = ["flask~=1.1.0", "toml==0.10.0"]
106
+
```
107
+
101
108
Pip allows adding so called console scripts, which are shell commands that execute some function in you program. You can add console scripts in a section `[package.metadata.pyo3-pack.scripts]`. The keys are the script names while the values are the path to the function in the format `some.module.path:class.function`, where the `class` part is optional. The function is called with no arguments. Example:
102
109
103
110
```toml
104
111
[package.metadata.pyo3-pack.scripts]
105
112
get_42 = "my_project:DummyClass.get_42"
106
113
```
107
114
108
-
You can also specify [trove classifiers](https://pypi.org/classifiers/) in your Cargo.toml under `package.metadata.pyo3-pack.classifier`, e.g.:
115
+
You can also specify [trove classifiers](https://pypi.org/classifiers/) in your Cargo.toml under `package.metadata.pyo3-pack.classifier`:
109
116
110
117
```toml
111
118
[package.metadata.pyo3-pack]
112
119
classifier = ["Programming Language :: Python"]
113
120
```
114
121
122
+
You can use other fields from the [python core metadata](https://packaging.python.org/specifications/core-metadata/) in the `[package.metadata.pyo3-pack]` section, specifically ` maintainer`, `maintainer-email` and `requires-python` (string fields), as well as `requires-external`, `project-url` and `provides-extra` (lists of strings).
0 commit comments