Zach Mueller
487505ff45
Allow for str versions of dicts based on typing ( #30227 )
...
* Bookmark, initial impelemtation. Need to test
* Clean
* Working fully, woop woop
* I think working version now, testing
* Fin!
* rm cast, could keep None
* Fix typing issue
* rm typehint
* Add test
* Add tests and make more rigid
2024-04-16 08:15:09 -04:00
Xu Song
8fd2de933c
Add test for parse_json_file and change typing to os.PathLike ( #30183 )
...
* Add test for parse_json_file
* Change Path to PathLike
* Fix `Import block is un-sorted or un-formatted`
* revert parse_json_file
* Fix ruff format
* Add parse_json_file test
2024-04-15 09:34:36 +01:00
Yih-Dar
e84bf1f734
⚠️ Time to say goodbye to py37 ( #24091 )
...
* fix
---------
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2023-06-28 07:22:39 +02:00
Xuehai Pan
ee4bc07474
Support union types `X | Y` syntax for `HfArgumentParser` for Python 3.10+ ( #23126 )
...
* Support union types `X | Y` syntax for `HfArgumentParser` for Python 3.10+
* Add tests for PEP 604 for `HfArgumentParser`
* Reorganize tests
2023-05-03 10:49:54 -04:00
Sylvain Gugger
6f79d26442
Update quality tooling for formatting ( #21480 )
...
* Result of black 23.1
* Update target to Python 3.7
* Switch flake8 to ruff
* Configure isort
* Configure isort
* Apply isort with line limit
* Put the right black version
* adapt black in check copies
* Fix copies
2023-02-06 18:10:56 -05:00
Konstantin Dobler
1e3f17b5ab
Enhance HfArgumentParser functionality and ease of use ( #20323 )
...
* Enhance HfArgumentParser
* Fix type hints for older python versions
* Fix and add tests (+formatting)
* Add changes
* doc-builder formatting
* Remove unused import "Call"
2022-11-21 12:33:37 -05:00
IMvision12
2df602870b
Added tests for yaml and json parser ( #19219 )
...
* Added tests for yaml and json
* Added tests for yaml and json
2022-09-27 16:25:57 -04:00
Felix Schneider
86387fe87f
Add an option to `HfArgumentParser.parse_{dict,json_file}` to raise an Exception when there extra keys ( #18692 )
...
* Update parser to track unneeded keys, off by default
* Fix formatting
* Fix docstrings and defaults in HfArgparser
* Fix formatting
2022-08-31 20:26:45 +02:00
罗崚骁(LUO Lingxiao)
81643edda5
Support PEP 563 for HfArgumentParser ( #15795 )
...
* Support PEP 563 for HfArgumentParser
* Fix issues for Python 3.6
* Add test for string literal annotation for HfArgumentParser
* Remove wrong comment
* Fix typo
* Improve code readability
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Use `isinstance` to compare types to pass quality check
* Fix style
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-03-17 13:51:37 -04:00
Lysandre Debut
29c10a41d0
[Test refactor 1/5] Per-folder tests reorganization ( #15725 )
...
* Per-folder tests reorganization
Co-authored-by: sgugger <sylvain.gugger@gmail.com>
Co-authored-by: Stas Bekman <stas@stason.org>
2022-02-23 15:46:28 -05:00