Commit Graph

12329 Commits

Author SHA1 Message Date
harupy
ea9db0ebbe Add Option to Dict.keys field 2023-01-15 16:43:13 +09:00
harupy
82892f3e0e Remove commented-out code 2023-01-15 16:10:51 +09:00
harupy
fdd3beaf58 Fix clippy errors 2023-01-15 15:04:15 +09:00
harupy
ae770996f6 Fix scan_expression and compile_dict 2023-01-15 14:54:58 +09:00
harupy
cdb1323515 Fix scan_expression and compile_dict 2023-01-15 13:22:05 +09:00
harupy
49b682edca Fix unparse 2023-01-15 13:11:55 +09:00
harupy
e1f41e83d1 Fix dict spreading in dict literal 2023-01-15 13:01:59 +09:00
Jim Fasarakis-Hilliard
acbc517b55 Merge pull request #4443 from bluetech/non-logical-newline-token-fixup
Fixup parse_tokens after "Add NonLogicalNewline token"
2023-01-14 12:49:04 +02:00
Jim Fasarakis-Hilliard
253b62f8b0 Merge pull request #4447 from burrbull/ci-update
update ci actions
2023-01-14 12:46:34 +02:00
Ran Benita
cb97a80350 Fixup parse_tokens after "Add NonLogicalNewline token"
I only updated `parse()` to ignore `NonLogicalNewline`, didn't notice
it's also needed in `parse_tokens()`.
2023-01-14 11:52:33 +02:00
Andrey Zgarbul
84897d4834 check caching 2023-01-14 12:39:17 +03:00
Andrey Zgarbul
a9696d8501 update ci actions 2023-01-14 12:03:43 +03:00
yt2b
8828fd17a0 Alternate float format doesn't work correctly. (#4446) 2023-01-14 16:48:03 +09:00
Noa
aa3d24ea2a Merge pull request #4346 from coolreader18/wordcode
Switch from 64-bit instruction enum to out-of-line arg values
2023-01-13 12:20:36 -06:00
Jeong YunWon
68d413e923 Merge pull request #4444 from messense/fix-format-spec-multi-byte
Fix panic when parsing a format spec with multi-byte character
2023-01-13 21:53:32 +09:00
messense
ee5a1c9002 Fix panic when parsing a format spec with multi-byte character 2023-01-13 14:40:20 +08:00
Noa
2861c874ed Switch from 64-bit instruction enum to out-of-line arg values 2023-01-12 23:05:17 -06:00
Jim Fasarakis-Hilliard
91a897dd74 Merge pull request #4442 from bluetech/non-logical-newline-token
lexer: Add `NonLogicalNewline` token
2023-01-12 19:18:23 +02:00
Ran Benita
e64faa781c Add NonLogicalNewline token
This token is completely ignored by the parser, but it's useful for
other users of the lexer, such as the Ruff linter. For example, the
token is helpful for a "trailing comma" lint.

The same idea exists in Python's `tokenize` module - there is a NEWLINE
token (logical newline), and a NL token (non-logical newline).

Fixes #4385.
2023-01-12 16:47:12 +02:00
Jeong YunWon
9bbe745a33 Merge pull request #4437 from not-my-profile/fix-parser-docs.rs
Fix docs.rs build for rustpython-parser
2023-01-12 19:02:21 +09:00
Martin Fischer
658d5a8b7e Fix docs.rs build for rustpython-parser
docs.rs failed to build the documentation of the recently released
rustpython-parser 0.2.0 because the build.rs script couldn't write the
parser.rs file because docs.rs builds the documentation in a sandbox
with a read-only filesystem.

This commit fixes this by writing the parser.rs file to the cargo output
directory instead, as recommended by the docs.rs documentation.[1]

Fixes #4436.

[1]: https://docs.rs/about/builds#read-only-directories
2023-01-11 09:58:10 +01:00
Noa
c7faae9b22 Bump all crate versions to 0.2.0 v0.2.0 2023-01-11 00:14:28 -06:00
Jeong YunWon
c38babe5cb Merge pull request #4435 from RustPython/dependabot/cargo/bzip2-0.4.4
Bump bzip2 from 0.4.3 to 0.4.4
2023-01-11 10:27:27 +09:00
dependabot[bot]
2c696bca94 Bump bzip2 from 0.4.3 to 0.4.4
Bumps [bzip2](https://github.com/alexcrichton/bzip2-rs) from 0.4.3 to 0.4.4.
- [Release notes](https://github.com/alexcrichton/bzip2-rs/releases)
- [Commits](https://github.com/alexcrichton/bzip2-rs/commits/0.4.4)

---
updated-dependencies:
- dependency-name: bzip2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-10 22:31:07 +00:00
Jeong YunWon
48103030e4 Merge pull request #4433 from lgyanf/devcontainer
[RFC] Add Github Codespaces configuration (devcontainer.json)
2023-01-10 08:28:39 +09:00
Ivan Gromov
1e9d9aed84 Create devcontainer.json 2023-01-09 22:22:17 +00:00
Jeong YunWon
a3e223d78e Merge pull request #4432 from youknowone/cspell
first cspell dict
2023-01-09 20:46:40 +09:00
Jeong YunWon
1848c45302 first cspell dict 2023-01-09 19:57:23 +09:00
Jeong YunWon
fc9e531272 Merge pull request #4414 from moreal/keyboard-int-exitcode
Correct exitcode of KeyboardInterrupt
2023-01-08 17:48:44 +09:00
Moreal
16579aeafe Correct exitcode of KeyboardInterrupt 2023-01-08 14:49:51 +09:00
Steve Shi
765933136c Implement Sqlite3 Module (#4260)
* add supporting for PyAtomic<PyObject>

* create sqlite module

* add dependency sqlite3-sys

* add module constants

* import sqlite3 from cpython

* adjust lib

* add module structure

* impl Connection.cursor

* add module exceptions

* impl lstrip_sql

* impl statement new

* wip cursor.execute

* wip cursor

* wip error to exception

* add SqliteRaw and SqliteStatementRaw

* impl statement parameters binding

* wip cursor.execute

* add test_sqlite

* impl closeable connection

* impl closeable cursor

* impl cursor.executemany

* impl cursor.executescript

* impl cursor.fetch*

* impl connection.backup

* stage 1

* add support connection.backup with progress

* fix backup deadlock

* support changable isolation_level

* impl converter

* impl adapter

* impl text_factory and blob

* impl create_function

* impl create_function 2

* fix empty statement

* impl blob support

* impl create_aggregate

* impl create_aggregate 2

* refactor create_*

* impl enable_callback_traceback

* impl create_collation

* refactor create_* with CallbackData

* fix text and blob use SQLITE_TRANSIENT

* fix str to SQLITE_TEXT

* impl thread check

* impl Connection Factory

* impl busy timeout

* shift sqlite3-sys -> libsqlite3-sys

* refactor CallbackData

* impl create_window_function

* refactor callback functions

* add module attr converters

* fix nullable isolation_level

* add module attr adapters

* fix nullable adapt proto

* impl set_authorizer

* impl trace_callback

* impl set_progress_handler

* impl cancellable sqlite function*

* impl attributes for Connection

* fix some failed tests

* impl Row

* impl Blob methods

* impl Blob subscript & ass_subscript

* pass tests

* rebase

* no sqlite for wasm

* use ThreadId instead u64

* no libsqlite3-sys for wasm

* fix into_cstring for all platform

* fixup

* rebase

* fix windows into_bytes

* disable sqlite for android

* fixup
2023-01-07 22:03:24 +02:00
yt2b
22a5a83fda PyInt.format only raises ValueError (#4428) 2023-01-08 02:06:04 +09:00
Jeong YunWon
604aa427fa Merge pull request #4429 from youknowone/fix-format
Fix nightly clippy warnings
2023-01-07 21:38:41 +09:00
Jeong YunWon
8d36fe68e7 Fix nightly clippy warnings 2023-01-07 21:07:10 +09:00
Jeong YunWon
55aac852fd Merge pull request #4427 from yt2b/fix_integer_format
Fix integer format
2023-01-07 19:41:32 +09:00
Jeong YunWon
ddc2e1b81d Merge pull request #4426 from harupy/include-comment
Include comment text in token
2023-01-07 19:38:51 +09:00
yt2b
4bec6e8cc8 add from_bytes 2023-01-07 12:44:28 +09:00
Jeong YunWon
ff0f0ac25c Merge pull request #4425 from yt2b/fix_formatspec_parse
Fix `FormatSpec::parse`.
2023-01-07 02:18:32 +09:00
harupy
d532160333 Include comment text in token 2023-01-06 23:29:20 +09:00
yt2b
3677013765 Fix tests 2023-01-06 23:28:33 +09:00
yt2b
32cf0185bd Fix functions 2023-01-06 22:56:30 +09:00
Jeong YunWon
ba427c8690 Merge pull request #4422 from harupy/impl-Default-for-Location
Implement `Default` for `Location`
2023-01-06 01:43:15 +09:00
Jeong YunWon
f1ca3596c0 Merge pull request #4421 from yt2b/implement_string_format_validation
Implement string format validation
2023-01-06 01:43:04 +09:00
yt2b
e60a264dc8 Remove map_err 2023-01-06 00:02:39 +09:00
yt2b
1534112cfe Add test 2023-01-05 23:55:23 +09:00
yt2b
f84dd2e84f Implement format validation 2023-01-05 23:55:23 +09:00
Jeong YunWon
2f94c07609 Merge pull request #4361 from yt2b/fix_fstring
Fix f-string padding
2023-01-05 23:10:59 +09:00
harupy
3602d2602b Implement Default for Location 2023-01-05 22:48:47 +09:00
Jeong YunWon
062a543c7f Fix f-string padding
Co-Authored-By: yt2b <reinventing.the.wheels@gmail.com>
2023-01-05 22:29:11 +09:00
Jim Fasarakis-Hilliard
ed5b182c44 Merge pull request #4420 from harupy/simplify-string-check
Simplify string check in `Lexer.lex_identifier`
2023-01-05 12:45:52 +02:00