Skip to content

Commit

Permalink
Implement upstream bugfix (#8)
Browse files Browse the repository at this point in the history
* Update dependencies

* Update project meta and setuptools_rust

* Implement upstream changes to ExecResult.code
  • Loading branch information
Jonxslays authored Jun 30, 2022
1 parent e552158 commit 9ceb26f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ crate-type = ["cdylib"]
pyo3 = { version = "0.15", features = ["extension-module"] }
pyo3-asyncio = { version = "0.15", features = ["tokio-runtime"] }
tokio = { version = "1" }
piston_rs = "^0.4.2"
piston_rs = "0.4.3"
6 changes: 3 additions & 3 deletions piston_rspy/piston_rspy.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class ExecResult:
output: `str`
The text sent to both `stdout`, and `stderr` during
execution.
code: `int`
The exit code returned by the process.
code: `int | None`
The optional exit code returned by the process.
signal: `str | None`
The optional signal sent to the process. (`SIGKILL` etc)
Expand All @@ -129,7 +129,7 @@ class ExecResult:
stdout: str
stderr: str
output: str
code: int
code: int | None
signal: str | None
def is_ok(self) -> bool:
"""Whether or not the execution was ok.
Expand Down
9 changes: 2 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
[project]
name = "piston_rspy"
version = "0.3.2"
version = "0.4.0"
description = "Python bindings for piston_rs."
readme = "README.md"
author = "Jonxslays"
documentation = "https://jonxslays.github.io/piston_rspy/piston_rspy"
issue-tracker = "https://github.com/Jonxslays/piston_rspy/issues"
repository = "https://github.com/Jonxslays/piston_rspy"
url = "https://github.com/Jonxslays/piston_rspy"
requires-python = ">=3.7,<3.11"
readme = "README.md"

[tool.pyright]
typeCheckingMode = "strict"
Expand Down
6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
black==21.11b1
black==22.6.0
maturin==0.12.2
pdoc3==0.10.0
pyright==0.0.13
setuptools_rust==1.1.2
pyright==1.1.256
setuptools_rust==1.3.0
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
name=meta["name"],
version=meta["version"],
description=meta["description"],
author=meta["author"],
author="Jonxslays",
long_description=long_description,
long_description_content_type="text/markdown",
license="MIT",
url=meta["url"],
url="https://github.com/Jonxslays/piston_rspy",
project_urls={
"Documentation":meta["documentation"],
"Source": meta["repository"],
"Bug Tracker": meta["issue-tracker"],
"Documentation": "https://jonxslays.github.io/piston_rspy/piston_rspy",
"Source": "https://github.com/Jonxslays/piston_rspy",
"Bug Tracker": "https://github.com/Jonxslays/piston_rspy/issues",
},
classifiers=[
"Development Status :: 3 - Alpha",
Expand Down
6 changes: 3 additions & 3 deletions src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl ExecResult {
stdout: String,
stderr: String,
output: String,
code: isize,
code: Option<isize>,
signal: Option<String>,
) -> Self {
Self {
Expand Down Expand Up @@ -85,9 +85,9 @@ impl ExecResult {
self.inner.output.clone()
}

/// `int`: The exit code returned by the process.
/// `int | None`: The optional exit code returned by the process.
#[getter]
fn code(&self) -> isize {
fn code(&self) -> Option<isize> {
self.inner.code
}

Expand Down

0 comments on commit 9ceb26f

Please sign in to comment.