Commit Graph
13471 Commits
Author SHA1 Message Date
Jeong, YunWon 2a62ef7344 Merge pull request #5169 from Blues-star/main
Update `calendar.py` and `test_calendar.py`  from CPython v3.12
2024-02-19 00:30:15 +09:00
Blues-star 258342e1ca Update test_calendar.py from CPython v3.12.0 2024-02-18 15:36:45 +08:00
Blues-star 69e8e4be43 Update calendar.py from CPython v3.12.0 2024-02-18 15:33:01 +08:00
Jeong, YunWon 1c93c1630b Merge pull request #5164 from dchiquito/frozenset-hash
Use CPython hash algorithm for frozenset
2024-02-10 14:55:24 +09:00
Jeong, YunWon ec9f2cedd1 Merge pull request #5165 from dchiquito/unused-collections-bool
Removed unused __bool__ methods
2024-02-10 12:00:55 +09:00
Jeong, YunWon 10055772d8 Merge pull request #5163 from dchiquito/fix-benches
Fix benchmarks by replacing rust-cpython with pyo3

- Replace `cpython` and `python3-sys` dependencies with `pyo3`.
- Add `html_report` feature to `criterion`, it will be required in a
  future release.
- Remove `anyhow`. It was unused and cargo cleaned it up automatically.
- Use `compile` and `exec` from within the CPython context to
compile and execute benchmarks. There's probably more overhead to that than
the internal API had, but that overhead should be consistent per
benchmark.
2024-02-10 11:49:17 +09:00
Ikko Eltociear Ashimine 61e40de32b Fix typo in slot.rs (#5162)
overriden -> overridden
2024-02-10 11:43:40 +09:00
Daniel Chiquitoandfanninpm 074d228a7a Use correct TODO syntax
Co-authored-by: fanninpm <luxverdans@sbcglobal.net>
2024-02-09 21:41:45 -05:00
Daniel Chiquito bf461cdebc Use CPython hash algorithm for frozenset
The original hash algorithm just XOR'd all the hashes of the elements of
the set, which is problematic. The CPython algorithm is required to pass
the tests.

- Replace `PyFrozenSet::hash` with CPython's algorithm
- Remove unused `hash_iter_unorded` functions
- Add `frozenset` benchmark
- Enable tests
- Lower performance expectations on effectiveness test
- Adjust `slot::hash_wrapper` so that it doesn't rehash the computed
  hash value in the process of converting PyInt to PyHash.
2024-02-09 21:02:40 -05:00
Daniel Chiquito ffc52ef87c Removed unused __bool__ methods
Python does not define `list().__bool__`, `dict().__bool__`, and
`str().__bool__`, and some tests were failing because they were
defined.
I could not find any references to them and deleting them doesn't
seem to break anything.
2024-02-09 20:58:17 -05:00
Daniel Chiquito ea1f72e92d Replace rust-cpython with pyo3 in benches
Update the actual benchmark harnesses.

Because the internal APIs previously used are no longer available, I
opted to use `compile` and `exec` from within the CPython context to
compile and execute code. There's probably more overhead to that than
the internal API had, but that overhead should be consistent per
benchmark.

If anyone cares about hyperoptimizing benchmarks then they can optimize
the harness as well.
2024-02-09 16:12:47 -05:00
Daniel Chiquito 9693ad9b11 Replace rust-cpython with pyo3 in benchmarks
The benchmarks have been broken since Python 3.10 deprecated the API
they were using to parse and execute CPython baselines. Since then
rust-cpython has been deprecated in favor of pyo3.

- Replace `cpython` and `python3-sys` with `pyo3`.
- Add `html_report` feature to `criterion`, it will be required in a
  future release.
- Remove `anyhow`. It was unused and cargo cleaned it up automatically.
2024-02-09 15:15:22 -05:00
kingiler bdf228eb42 Fix bug in binascii uu encoding. Pass more related unit tests. (#5160)
* Fix bug in binascii, passes more unit tests.

* Pass more additional tests due to this PR.
2024-02-09 22:42:39 +09:00
Jeong, YunWon c4b1cc69be Merge pull request #5158 from dchiquito/fix-int-rounding
Fix integer rounding
2024-02-09 13:22:36 +09:00
Daniel Chiquito 36b9219e32 Bump ahash from 0.8.3 to 0.8.7
When building the project for the Miri CI step, the latest nightly
version apparently conflicts with the older `ahash` 0.8.3. Updating to
0.8.7 fixed the build for me locally.
2024-02-07 18:40:28 -05:00
Daniel Chiquito 43d7c71a68 Fix integer rounding
The [docs](https://docs.python.org/3/library/functions.html#round)
specify that calling `round` with a negative precision removes
significant digits, so that `round(12345, -2) == 12300`. The
implementation was simply returning the original integer.

Additionally, `round(a, b)` is implemented as `(a / 10^b) * 10^b`, using
half-even rounding during the division.
2024-02-07 14:19:17 -05:00
Alin-Ioan Alexandru 3eda1cf3b4 Deprecation warning fix for __complex__ (#5152) 2024-01-25 14:54:06 +09:00
deantvv 6917b4c2ca os: ns_to_sec rounding (#5150)
In cpython, they use `_PyTime_ROUND_FLOOR` to read time.
But in RustPython, we use `[Duration::from_secs_f64](https://doc.rust-lang.org/std/time/struct.Duration.html#method.try_from_secs_f64)` to read time.

Therefore, RustPython isn't affected by the rounding issue in the way
that cpython does. We can safely ignore the `0.5*1e-9` bit in
`ns_to_sec` function.
2024-01-23 20:09:22 +09:00
kenny the :/ aaae566231 Raise error on power with negative number (#5143) 2024-01-12 21:16:53 +09:00
NakanoMikuandJeong, YunWon 28f0fa48a4 Fix abc error messages (#5140)
Co-authored-by: Jeong, YunWon <jeong@youknowone.org>
2024-01-11 17:48:56 +09:00
Jeong, YunWon 1983138c91 Merge pull request #5148 from coolreader18/upd-nix
Update nix and socket2
2024-01-10 03:12:13 +09:00
Jeong, YunWon 9cc571be95 Fix windows stdlib build 2024-01-09 20:53:58 +09:00
Noa 602015fca1 Update nix and socket2 2024-01-09 20:53:58 +09:00
Evan Rittenhouse 1ab133dae8 None.__ne__(None) should be NotImplemented (#5124) 2024-01-08 15:03:57 +09:00
Jeong, YunWon 317f449454 Merge pull request #5126 from RustPython/dependabot/cargo/openssl-0.10.60
Bump openssl from 0.10.55 to 0.10.60
2023-12-30 18:04:30 +09:00
Jeong, YunWon 32f662ae80 Bump openssl from 0.10.55 to 0.10.62 2023-12-30 17:14:08 +09:00
Jeong, YunWon 7236109d75 Merge pull request #5144 from youknowone/clippy
Fix 1.75 clippy warnings
2023-12-30 13:16:10 +09:00
Jeong YunWon 506c8a633e Fix redox and nightly 2023-12-30 12:53:57 +09:00
Jeong YunWon a309cb5d2c Fix 1.75 clippy warnings 2023-12-30 11:48:40 +09:00
Jeong, YunWon 5001b2e572 Merge pull request #5142 from youknowone/windows-sys
Windows sys
2023-12-30 03:48:06 +09:00
Jeong, YunWon 756088e7fb more winapi to windows-sys 2023-12-29 00:40:04 +09:00
Jeong, YunWon 4729ca3af0 Drop winapi from rustpython-vm 2023-12-28 23:44:47 +09:00
Jeong, YunWon cccfb08835 replace winbase winnt to windows-sys 2023-12-28 22:40:49 +09:00
Jeong, YunWon d01909a524 replace handleapi to windows-sys 2023-12-28 22:28:49 +09:00
Jeong, YunWon ee128eac7c replace errorhandling to windows-sys 2023-12-28 22:28:33 +09:00
Jeong, YunWon 6df9732965 replace wincon to windows-sys 2023-12-28 22:28:33 +09:00
Jeong, YunWon 8a84a479f1 remove processthreadsapi 2023-12-28 22:28:33 +09:00
Jeong, YunWon 7513017e21 replace sysinfoapi to windows-sys 2023-12-28 22:28:33 +09:00
Jeong, YunWon adf0788895 bump up windows{-sys} 2023-12-28 22:28:33 +09:00
Jeong, YunWon fc91cd8bc7 clean up winapi features (#5141) 2023-12-28 21:51:26 +09:00
Michał Moskal 459cad8407 update indexmap to 1.9.3 (#5128) 2023-12-28 13:08:08 +09:00
Jeong, YunWon 863a5b5a49 Merge pull request #5134 from NakanoMiku39/main
Update libraries and test files from CPython v3.12
2023-12-28 13:01:13 +09:00
NakanoMiku 1c6336b350 Merge branch 'RustPython:main' into main 2023-12-28 03:26:14 +08:00
Jeong, YunWon fb12a4c219 Merge pull request #5136 from youknowone/fix-wasi-ci
Fix wasi CI
2023-12-28 02:50:30 +09:00
Jeong YunWon 16a3edd432 Fix wasi CI 2023-12-28 02:34:41 +09:00
Jeong, YunWon ebc8f60e21 Merge pull request #5135 from youknowone/fix-malachite-version
Fix malachite-bigint version
2023-12-28 02:33:21 +09:00
Jeong YunWon 727f97fd48 Fix malachite-bigint version 2023-12-28 01:50:02 +09:00
NakanoMiku de626b8627 Update test_file.py from CPython v3.12.0 2023-12-25 15:19:28 +08:00
NakanoMiku f519ffdb18 Add asynchat.py and asyncore.py from CPython v3.12.0 2023-12-24 04:11:04 +08:00
NakanoMiku 57f9478d16 Add test_bz2.py from CPython v3.12.0 2023-12-24 04:07:12 +08:00