pyuiua 0.0.2__tar.gz → 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {pyuiua-0.0.2 → pyuiua-0.0.4}/Cargo.lock +5 -5
  2. {pyuiua-0.0.2 → pyuiua-0.0.4}/Cargo.toml +1 -1
  3. {pyuiua-0.0.2 → pyuiua-0.0.4}/PKG-INFO +4 -2
  4. {pyuiua-0.0.2 → pyuiua-0.0.4}/README.md +1 -1
  5. {pyuiua-0.0.2 → pyuiua-0.0.4}/pyproject.toml +5 -3
  6. {pyuiua-0.0.2 → pyuiua-0.0.4}/pyuiua.pyi +1 -1
  7. {pyuiua-0.0.2 → pyuiua-0.0.4}/src/convert/to_python.rs +0 -1
  8. {pyuiua-0.0.2 → pyuiua-0.0.4}/src/uiua_runtime.rs +0 -1
  9. {pyuiua-0.0.2 → pyuiua-0.0.4}/tests/test_stack.py +6 -6
  10. {pyuiua-0.0.2 → pyuiua-0.0.4}/tests/test_uiua.py +1 -1
  11. {pyuiua-0.0.2 → pyuiua-0.0.4}/uv.lock +1 -1
  12. {pyuiua-0.0.2 → pyuiua-0.0.4}/.gitattributes +0 -0
  13. {pyuiua-0.0.2 → pyuiua-0.0.4}/.github/workflows/build.yml +0 -0
  14. {pyuiua-0.0.2 → pyuiua-0.0.4}/.github/workflows/lint-and_test.yml +0 -0
  15. {pyuiua-0.0.2 → pyuiua-0.0.4}/.gitignore +0 -0
  16. {pyuiua-0.0.2 → pyuiua-0.0.4}/LICENSE +0 -0
  17. {pyuiua-0.0.2 → pyuiua-0.0.4}/Makefile +0 -0
  18. {pyuiua-0.0.2 → pyuiua-0.0.4}/py.typed +0 -0
  19. {pyuiua-0.0.2 → pyuiua-0.0.4}/src/convert/mod.rs +0 -0
  20. {pyuiua-0.0.2 → pyuiua-0.0.4}/src/convert/to_uiua.rs +0 -0
  21. {pyuiua-0.0.2 → pyuiua-0.0.4}/src/lib.rs +0 -0
  22. {pyuiua-0.0.2 → pyuiua-0.0.4}/tests/__init__.py +0 -0
  23. {pyuiua-0.0.2 → pyuiua-0.0.4}/tests/conftest.py +0 -0
  24. {pyuiua-0.0.2 → pyuiua-0.0.4}/tests/test_arrays.py +0 -0
  25. {pyuiua-0.0.2 → pyuiua-0.0.4}/tests/test_boxed.py +0 -0
  26. {pyuiua-0.0.2 → pyuiua-0.0.4}/tests/test_errors.py +0 -0
  27. {pyuiua-0.0.2 → pyuiua-0.0.4}/tests/test_scalars.py +0 -0
@@ -2062,7 +2062,7 @@ dependencies = [
2062
2062
 
2063
2063
  [[package]]
2064
2064
  name = "pyuiua"
2065
- version = "0.0.2"
2065
+ version = "0.0.4"
2066
2066
  dependencies = [
2067
2067
  "pyo3",
2068
2068
  "uiua",
@@ -3645,18 +3645,18 @@ checksum = "dd15f8e0dbb966fd9245e7498c7e9e5055d9e5c8b676b95bd67091cd11a1e697"
3645
3645
 
3646
3646
  [[package]]
3647
3647
  name = "zerocopy"
3648
- version = "0.8.28"
3648
+ version = "0.8.30"
3649
3649
  source = "registry+https://github.com/rust-lang/crates.io-index"
3650
- checksum = "43fa6694ed34d6e57407afbccdeecfa268c470a7d2a5b0cf49ce9fcc345afb90"
3650
+ checksum = "4ea879c944afe8a2b25fef16bb4ba234f47c694565e97383b36f3a878219065c"
3651
3651
  dependencies = [
3652
3652
  "zerocopy-derive",
3653
3653
  ]
3654
3654
 
3655
3655
  [[package]]
3656
3656
  name = "zerocopy-derive"
3657
- version = "0.8.28"
3657
+ version = "0.8.30"
3658
3658
  source = "registry+https://github.com/rust-lang/crates.io-index"
3659
- checksum = "c640b22cd9817fae95be82f0d2f90b11f7605f6c319d16705c459b27ac2cbc26"
3659
+ checksum = "cf955aa904d6040f70dc8e9384444cb1030aed272ba3cb09bbc4ab9e7c1f34f5"
3660
3660
  dependencies = [
3661
3661
  "proc-macro2",
3662
3662
  "quote",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "pyuiua"
3
- version = "0.0.2"
3
+ version = "0.0.4"
4
4
  edition = "2024"
5
5
  readme = "README.md"
6
6
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyuiua
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -22,6 +22,8 @@ Keywords: uiua,array-programming,python-bindings,interpreter
22
22
  Author: Katie Gardner
23
23
  Requires-Python: >=3.10
24
24
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
25
+ Project-URL: Homepage, https://github.com/KatieLG/pyuiua
26
+ Project-URL: Repository, https://github.com/KatieLG/pyuiua
25
27
 
26
28
  # PyUiua
27
29
 
@@ -68,7 +70,7 @@ print(uiua.pop()) # 15
68
70
  uiua.push(1)
69
71
  uiua.push(2)
70
72
  uiua.push(3)
71
- print(uiua.stack()) # [3, 2, 1]
73
+ print(uiua.stack()) # [1, 2, 3]
72
74
  print(len(uiua)) # 3
73
75
 
74
76
  # Clear the stack
@@ -43,7 +43,7 @@ print(uiua.pop()) # 15
43
43
  uiua.push(1)
44
44
  uiua.push(2)
45
45
  uiua.push(3)
46
- print(uiua.stack()) # [3, 2, 1]
46
+ print(uiua.stack()) # [1, 2, 3]
47
47
  print(len(uiua)) # 3
48
48
 
49
49
  # Clear the stack
@@ -1,14 +1,12 @@
1
1
  [project]
2
2
  name = "pyuiua"
3
- version = "0.0.2"
3
+ version = "0.0.4"
4
4
  description = "Python bindings for the Uiua programming language."
5
5
  license = { file = "LICENSE" }
6
6
  authors = [{ name = "Katie Gardner" }]
7
7
  readme = "README.md"
8
8
  requires-python = ">=3.10"
9
9
  keywords = ["uiua", "array-programming", "python-bindings", "interpreter"]
10
- homepage = "https://github.com/KatieLG/pyuiua"
11
- repository = "https://github.com/KatieLG/pyuiua"
12
10
  classifiers = [
13
11
  "Development Status :: 4 - Beta",
14
12
  "Intended Audience :: Developers",
@@ -27,6 +25,10 @@ classifiers = [
27
25
  "Typing :: Typed",
28
26
  ]
29
27
 
28
+ [project.urls]
29
+ Homepage = "https://github.com/KatieLG/pyuiua"
30
+ Repository = "https://github.com/KatieLG/pyuiua"
31
+
30
32
  [tool.maturin]
31
33
  features = ["pyo3/extension-module"]
32
34
  include = ["pyuiua.pyi", "py.typed"]
@@ -87,7 +87,7 @@ class Uiua:
87
87
  >>> len(u)
88
88
  >>> u.stack()
89
89
  2
90
- [[1, 2, 3], 42]
90
+ [42, [1, 2, 3]]
91
91
  """
92
92
  ...
93
93
 
@@ -62,7 +62,6 @@ fn uiua_scalar_to_pyobject<'py>(
62
62
  try_convert!(value.as_int(uiua, ""));
63
63
  try_convert!(value.as_num(uiua, ""));
64
64
  try_convert!(value.as_string(uiua, ""));
65
- try_convert!(value.as_bytes(uiua, "").map(std::borrow::Cow::into_owned));
66
65
 
67
66
  // If all conversions fail, raise a Type Error
68
67
  Err(PyErr::new::<pyo3::exceptions::PyTypeError, _>(format!(
@@ -48,7 +48,6 @@ impl PyUiua {
48
48
  .uiua
49
49
  .stack()
50
50
  .iter()
51
- .rev()
52
51
  .map(|v| uiua_value_to_pyobject(py, v, &self.uiua))
53
52
  .collect();
54
53
 
@@ -6,11 +6,11 @@ from pyuiua import Uiua, UiuaValue
6
6
  @pytest.mark.parametrize(
7
7
  "code,expected",
8
8
  [
9
- ("1 2 3", [1, 2, 3]),
9
+ ("1 2 3", [3, 2, 1]),
10
10
  ("1", [1]),
11
11
  ("+2 3", [5]),
12
- ('1 "hello" 3.14', [1, "hello", 3.14]),
13
- ("[1 2 3] [4 5 6]", [[1, 2, 3], [4, 5, 6]]),
12
+ ('1 "hello" 3.14', [3.14, "hello", 1]),
13
+ ("[1 2 3] [4 5 6]", [[4, 5, 6], [1, 2, 3]]),
14
14
  ],
15
15
  )
16
16
  def test_uiua_stack(uiua: Uiua, code: str, expected: list) -> None:
@@ -26,18 +26,18 @@ def test_push_stack_order(uiua: Uiua) -> None:
26
26
  uiua.push(1)
27
27
  uiua.push(2)
28
28
 
29
- assert uiua.stack() == [2, 1, 0]
29
+ assert uiua.stack() == [0, 1, 2]
30
30
 
31
31
 
32
32
  @pytest.mark.parametrize(
33
33
  "code,expected_stack",
34
- [("1 2 3 4 5", [1, 2, 3, 4, 5]), ("1_1 2_2", [[1, 1], [2, 2]])],
34
+ [("1 2 3 4 5", [5, 4, 3, 2, 1]), ("1_1 2_2", [[2, 2], [1, 1]])],
35
35
  )
36
36
  def test_stack_pop(uiua: Uiua, code: str, expected_stack: list) -> None:
37
37
  """Test popping from the uiua stack gives the top item on the stack"""
38
38
  uiua.run(code)
39
39
  assert uiua.stack() == expected_stack
40
- assert uiua.pop() == expected_stack[0]
40
+ assert uiua.pop() == expected_stack.pop()
41
41
 
42
42
 
43
43
  @pytest.mark.parametrize(
@@ -10,7 +10,7 @@ def test_scalar_operations(uiua: Uiua) -> None:
10
10
  uiua.run("+")
11
11
  uiua.run("×2")
12
12
 
13
- assert uiua.stack() == [16, []]
13
+ assert uiua.stack() == [[], 16]
14
14
 
15
15
 
16
16
  @pytest.mark.parametrize(
@@ -103,7 +103,7 @@ wheels = [
103
103
 
104
104
  [[package]]
105
105
  name = "pyuiua"
106
- version = "0.0.2"
106
+ version = "0.0.4"
107
107
  source = { editable = "." }
108
108
 
109
109
  [package.dev-dependencies]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes