Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
493 commits
Select commit Hold shift + click to select a range
7c3384e
Fix + test for missing optional packages
brentyi Nov 29, 2022
3425f0a
Add default helptext for positional args
brentyi Dec 8, 2022
e604f71
Support + tests for functools.partial (cc #23)
brentyi Dec 8, 2022
f79a2f8
Test `functools.wraps`, fix arg helptext for `functools.partial`
brentyi Dec 8, 2022
7d329cf
Support multiple functools.wraps / functools.partial calls
brentyi Dec 9, 2022
e88e690
Minor fix for 3.10-style annotations
brentyi Dec 9, 2022
32022ad
Bump version
brentyi Dec 12, 2022
10b2e38
Docs updates
brentyi Dec 23, 2022
721b217
Add functools.partial test for dataclasses
brentyi Dec 23, 2022
0c82e42
Add TypeForm placeholder, remove flax bug workaround
brentyi Dec 26, 2022
7d481ab
Fix broken f-string (cc #28)
brentyi Dec 30, 2022
46cb2ba
Handle unions with mixed nested/non-nested types more gracefully
brentyi Jan 4, 2023
444fbf9
Simplify call mechanics, extra TypedDict test
brentyi Jan 6, 2023
4016a27
Fix subcommand edge case + add test (cc #29)
brentyi Jan 6, 2023
37cf5b8
Bump version
brentyi Jan 6, 2023
ff146ed
Move mypy to dev dependencies (#31)
pyetras Jan 16, 2023
4ee8be0
Minor pydantic helptext improvements + tests
brentyi Jan 25, 2023
4ea2bdd
Add special casing for flax, formatting
brentyi Feb 12, 2023
9269b6f
Deprecate --tyro-print-completion in favor of --tyro-write-completion
brentyi Feb 12, 2023
1917cc4
Add support for os.PathLike (#37)
brentyi Feb 15, 2023
1ba5d5c
Add `return_unknown_args` to `tyro.cli` (#35)
JesseFarebro Feb 15, 2023
59f64bc
Add support for PathLike classes & objects with __new__ but no __init…
JesseFarebro Feb 17, 2023
b3c9871
Support variadic arguments (#39)
brentyi Feb 20, 2023
7fdc432
Smarter matching for default subcommands (#33)
brentyi Feb 20, 2023
c81478f
Drop Python version for codecov
brentyi Feb 20, 2023
847bdef
Version bump
brentyi Feb 20, 2023
47a211a
Fix mypy
brentyi Feb 20, 2023
5105811
Add test for configure() + subcommand(), closes #40
brentyi Mar 10, 2023
7d13757
Be more tolerant of static type errors as per #20
brentyi Mar 11, 2023
d994bb0
Fix `%` character as default str argument in dataclass (#41)
blurgyy Mar 11, 2023
52d9975
Extra test for subcommands with bad defaults
brentyi Mar 11, 2023
44e837b
Fix mypy, more aggressive caching
brentyi Mar 12, 2023
7d1da5a
Bump version, add cache cleanup
brentyi Mar 12, 2023
620073c
Add cache + container tests, use 3.10 for coverage
brentyi Mar 12, 2023
8ccd20b
Support container edge case in subcommands
brentyi Mar 12, 2023
6ed7282
Fix container subcommands for Python 3.10
brentyi Mar 12, 2023
45494a9
Typo
brentyi Mar 14, 2023
c3fd214
Tweak docs for type generation helpers
brentyi Mar 19, 2023
b956fff
Avoid unnecessary flax imports
brentyi Apr 28, 2023
5a20d69
Append action for variable-length containers (#47)
brentyi May 4, 2023
863eb12
More predictable boolean flag behavior (#50)
brentyi May 5, 2023
bfcd212
Add `UseAppendAction` note in nested sequence error messages
brentyi May 5, 2023
a7de7e3
Bump to 0.5.0
brentyi May 5, 2023
f4b9a70
Add `prefix_name` field to `tyro.conf.arg`
brentyi May 5, 2023
378b41c
Format
brentyi May 5, 2023
3c3e9f4
Remove debugging print statement (#51)
vwxyzjn May 5, 2023
4f9b3d3
Bump version
brentyi May 5, 2023
1d27a59
Add `tyro.conf.OmitArgPrefixes`
brentyi May 9, 2023
e25a020
Bump version
brentyi May 10, 2023
b92fc8b
Update _markers.py
brentyi May 11, 2023
3de5c7f
Set `allow_abbrev=False`
brentyi May 12, 2023
aa5d187
Docs formatting fix
brentyi May 15, 2023
3c6e9e2
Fix typing_extensions Literal bug
brentyi May 27, 2023
ad0d4c9
Update in-the-wild examples, tweak docs
brentyi Jun 5, 2023
c379edb
Minor refactor for populating parser specifications
brentyi Jun 5, 2023
7dee00d
Simplify base configs example
brentyi Jun 29, 2023
85b6b03
Python 3.11, Pydantic 2.0, switch away from poetry
brentyi Jul 3, 2023
1626cee
Support setting Tuple, Dict, and Union to empty in the command line. …
ShenhanQian Jul 4, 2023
54c22db
Bump version
brentyi Jul 5, 2023
827f1d6
Switch export style
brentyi Jul 5, 2023
2977c45
Fix version check for pydantic!=2.0
brentyi Jul 5, 2023
4d630c3
Add `hydra-zen` link
brentyi Jul 5, 2023
2264cab
Fix dependencies for docs build
brentyi Jul 20, 2023
fdd45e4
Fix edge cases when generating subcommands from Optional[] types
brentyi Jul 27, 2023
7fd53ac
Fix dummy dataclass warnings
brentyi Jul 27, 2023
ec2b5a8
Bump version
brentyi Jul 27, 2023
81a6ec4
Fix 3.7 install
brentyi Jul 27, 2023
a45e4d7
Fix mypy
brentyi Jul 27, 2023
cf6e178
Pin flax
brentyi Jul 27, 2023
512dc48
Fix helptext formatting edge cases
brentyi Jul 28, 2023
5c144d1
Rework test run conditions
brentyi Jul 28, 2023
5340498
Fix typo in README.md (#65)
eltociear Aug 29, 2023
83592d6
Better error messages (#63)
brentyi Sep 1, 2023
0fb5289
Typo
brentyi Sep 2, 2023
5498eec
Add conf.PositionalRequiredArgs (#66)
brentyi Sep 6, 2023
4d5f058
More error message tweaks (#67)
brentyi Sep 6, 2023
bb20982
Fix tyro.conf for pydantic>=2 (#69)
brentyi Sep 6, 2023
3324036
"Perhaps you meant:"
brentyi Sep 7, 2023
a47b2f8
Fix test
brentyi Sep 10, 2023
c31ff2d
Dependency cleanup
brentyi Sep 25, 2023
e73fbd2
Add `use_underscores` option (#76)
brentyi Sep 26, 2023
2b8579f
Update docs build
brentyi Sep 26, 2023
7a8c6f7
Fix yaml import error
brentyi Sep 27, 2023
86a6943
Patch underscore prefix edge case (#78)
brentyi Oct 5, 2023
d2906ae
Update docs build, README
brentyi Oct 5, 2023
c7400d9
Sync docs updates
brentyi Oct 19, 2023
f213383
Improved dictionaries: `TypedDict` support, `typing.[Required,NotRequ…
brentyi Oct 24, 2023
7a50cae
Implement custom constructor/proxy types (#82)
brentyi Oct 26, 2023
5907cd3
Bump version, docs + tests updates
brentyi Oct 30, 2023
f548625
Implement aliases (#83)
brentyi Oct 31, 2023
be0545f
Fix aliases example, add boolean tests
brentyi Oct 31, 2023
d1a4228
Make unpack-style args optional
brentyi Nov 13, 2023
5d571ac
Fix #86
brentyi Nov 14, 2023
a6e9d05
Add ValueError test for subcommands
brentyi Nov 14, 2023
5f2553d
Fix tuple of structs for Python>=3.9 syntax
brentyi Nov 14, 2023
fb58768
Bump version
brentyi Nov 14, 2023
4042f0d
Run black
brentyi Nov 14, 2023
43061a1
Add NotRequired test from #87
brentyi Nov 17, 2023
0c4dfa3
Fix TypedDict's total=False, NotRequired[] when default is provided
brentyi Nov 17, 2023
929c32a
Add warning for default values with unexpected types (#88)
brentyi Nov 18, 2023
afe73d6
Fix *args corner case, closes #84
brentyi Nov 18, 2023
a582270
Add test for #88
brentyi Nov 18, 2023
01e9a3c
Eliminate unnecessary warnings
brentyi Nov 18, 2023
2e79cb9
Housekeeping: coverage, remove dead branches, fix minor edge cases
brentyi Nov 19, 2023
ef92973
Fix type narrowing edge case for unions (#90)
brentyi Nov 23, 2023
bf65c56
Retain subcommand annotations (#92)
brentyi Nov 25, 2023
25ef301
Fix tuple + subcommand edge cases (#93)
brentyi Nov 25, 2023
6140aa1
Account for indent in subcommand helptext wrapping (#95)
brentyi Nov 26, 2023
8918cc3
Add support for mixed unions (#96)
brentyi Nov 26, 2023
1afc130
Add test from #100
brentyi Dec 1, 2023
e7ca5a2
Tooling: ruff, pyright
brentyi Dec 11, 2023
152b889
Improve PEP 585/604 annotation errors for older versions of Python (#…
brentyi Dec 12, 2023
f9283b7
Update README badge URLs
brentyi Dec 19, 2023
ed0eaac
Minor patch for pyright upgrade
brentyi Dec 20, 2023
d076c44
Fix default values in Pydantic (#109)
kevinddchen Dec 21, 2023
401bd0b
Support + test for `typing.NewType` (#106)
brentyi Dec 22, 2023
d901888
mro() => __mro__ (closes #104)
brentyi Dec 22, 2023
975f070
Add `default_instance` support for attrs, fix docs (#111)
brentyi Dec 22, 2023
98dbc5d
Bump version
brentyi Dec 22, 2023
db3ef1c
More comprehensive helptext tests, details
brentyi Dec 26, 2023
a32b88f
Fix helptext + tyro.conf.configure() edge cases
brentyi Dec 27, 2023
34d74a1
More succinct usage when a lot of options are present (#114)
brentyi Jan 1, 2024
3962ed8
Superficial cleanup
brentyi Jan 1, 2024
caf7bdb
Fix tyro.conf.Suppress for subcommands / nested types
brentyi Jan 14, 2024
9553886
Python 3.11 test + coverage fixes
brentyi Jan 14, 2024
6bef529
Use external field name in group helptext, add test for ~reproducing …
brentyi Jan 17, 2024
00e1695
Sphinx autodoc comment support, adapted from @kschwab / #115
brentyi Jan 18, 2024
bc55c77
Bump version
brentyi Jan 18, 2024
171b636
Fix subcommand override edge case (#117)
brentyi Jan 19, 2024
b42b485
Suppress mypy error
brentyi Jan 19, 2024
d242dda
Consolidate field list generation (#118)
brentyi Jan 19, 2024
7049ef0
Fix edge case when default must be specified, and is specified in
brentyi Jan 20, 2024
d660da2
Support `typing.Self` (#120)
brentyi Jan 21, 2024
402f7a2
Fix type narrowing edge case, bump to 0.7.1 (#122)
brentyi Feb 1, 2024
1791cdd
Pin pyright
brentyi Feb 1, 2024
165b83d
Pin pyright
brentyi Feb 1, 2024
30803e8
Resolve pyright errors
brentyi Feb 2, 2024
0503950
(Should break tests) Add failing docstring tests
brentyi Feb 7, 2024
ea045c1
remove extraneous description setting (#124)
kevinddchen Feb 7, 2024
ffb4b6e
Bump version to 0.7.2
brentyi Feb 7, 2024
d560e5f
Minor docs fix for tab completions
brentyi Feb 15, 2024
f674d1d
Fix dictionary example commands in docs
brentyi Feb 15, 2024
a26cf34
Fix `init=False` and forward annotations for attrs (#126)
brentyi Feb 16, 2024
28082f8
Bump version
brentyi Feb 16, 2024
f70d6fc
Support `X | Y` and `list[T]` for older versions of Python (#134)
brentyi Apr 4, 2024
42d6944
Make _fields.py assertion much more helpful (#131)
pwais Apr 4, 2024
b43c668
Implement counter actions (#130)
brentyi Apr 4, 2024
eafae2e
Support Python 3.12 + PEP 695 (`type` statement, new type parameter s…
brentyi Apr 4, 2024
6720c58
Bump version to 0.8.0
brentyi Apr 4, 2024
c3ded1c
Fix edge case in container narrowing logic (#136)
brentyi Apr 5, 2024
3dee2d9
Bump version to 0.8.1
brentyi Apr 5, 2024
d7d2911
Run ruff
brentyi Apr 5, 2024
107b05e
Bump `typing_extensions` dependency to `>=4.7.0` for `ForwardRef` sup…
brentyi Apr 5, 2024
2fcdcd9
Switch to `uv` for CI
brentyi Apr 9, 2024
ec77792
Bump version, add internal mirror of `argparse`
brentyi Apr 9, 2024
f373efa
More tests, quality-of-life improvements for scripts with multiple wo…
brentyi May 10, 2024
6229067
Bump version
brentyi May 10, 2024
868c980
Support `typing.ReadOnly`, fix `typing.Final` edge case
brentyi May 12, 2024
f1707f2
Typo fixes + wording in marker docstrings
brentyi May 13, 2024
ed9e5e4
Cleaner stack traces for errors in `tyro.cli()`
brentyi May 16, 2024
6527d1d
Docs tweaks, run `prettier`
brentyi May 22, 2024
de5be4a
Profiling + performance improvements (~15%)
brentyi Jun 9, 2024
84991da
Profiling, more performance improvements
brentyi Jun 9, 2024
0969dc8
Bump docstring_parser, fix missing import test
brentyi Jun 10, 2024
2230076
Typing fixes
brentyi Jun 10, 2024
c886390
Fix mypy errors
brentyi Jun 11, 2024
720be8b
0.8.5
brentyi Jun 12, 2024
958f5fb
Improve error messages for custom constructors + tests (cc #145)
brentyi Jun 24, 2024
f1c5342
Fix pyright error from pydantic 2.7 update
brentyi Jun 24, 2024
c75bea7
Fix Python 3.7 tests
brentyi Jun 24, 2024
b2bea5c
Improve error messages for unsupported type annotations
brentyi Jun 24, 2024
202ef2b
Type ignore for mypy
brentyi Jun 24, 2024
532d38f
Whitespace formatting nit for docstrings
brentyi Jun 24, 2024
3f51b01
Update README.md
brentyi Jul 1, 2024
958bf0b
Improve docs + docstrings (related: #148, #149, #150)
brentyi Jul 29, 2024
dc51523
Fix errors from pyright update
brentyi Jul 29, 2024
084eee7
Docs wording nit
brentyi Jul 29, 2024
e226908
Remove unnecessary error message assert
brentyi Jul 31, 2024
51c6859
Recursively apply prefix_name for `tyro.conf.arg()`
brentyi Aug 7, 2024
bceff43
Add test for `torch.inference_mode()` decorator
brentyi Aug 7, 2024
a4809a2
Fix type narrowing edge case for sequences with zero-length default v…
brentyi Aug 8, 2024
0d79d52
Improve type narrowing support: Any within sequences,
brentyi Aug 8, 2024
af31044
ruff
brentyi Aug 8, 2024
faddd37
Fix tests for Python<3.10
brentyi Aug 8, 2024
29d7d20
Update autogenerated Python>=3.11 tests
brentyi Aug 8, 2024
668b072
Improve error messages when custom constructors are combined with
brentyi Aug 14, 2024
95e2c2f
Improve error message for variable-length sequences over nested types
brentyi Aug 14, 2024
be74b1f
Docs typo
brentyi Aug 14, 2024
4775974
Add `config=` argument to `tyro.cli()`. This will become redundant once
brentyi Aug 15, 2024
cb76e7b
0.8.7
brentyi Aug 15, 2024
956ab5e
0.8.8, add `tyro.extras.overridable_config_cli()`
brentyi Aug 15, 2024
2203ee6
Minor fix for `tyro.MISSING` docstring
brentyi Aug 15, 2024
42b9454
Show which subcommands unrecognized arguments are applied to (cc #152)
brentyi Aug 15, 2024
0631bc2
Add workaround for Python<=3.10 `get_type_hints()` bug (#157)
brentyi Aug 26, 2024
e6a4cfb
Add support for `datetime.{date,time,datetime}` types (#155)
brentyi Aug 26, 2024
8648be5
Bump version
brentyi Aug 26, 2024
07f1e95
Merge union choices when possible
brentyi Aug 27, 2024
7b32fa3
Fix completion script test for Python 3.7
brentyi Aug 27, 2024
1e68768
Bump version
brentyi Aug 27, 2024
6ab907f
`__builtins__` => `builtins`
brentyi Aug 29, 2024
cdb0254
Minor test, readme updates
brentyi Sep 6, 2024
fcadb01
Exclude pyright version with `Annotated` regression
brentyi Sep 7, 2024
072dd5f
Accomodate pyright updates
brentyi Sep 14, 2024
bf3f61a
Support Enum aliases (#162)
kevinddchen Sep 14, 2024
3b436a7
Support overriding behavior hint in argument helptext (#161)
brentyi Sep 18, 2024
791c9d6
`0.8.11`
brentyi Sep 18, 2024
01a77d4
Fix inconsistency between `type[T]` and `typing.Type[T]` annotations …
brentyi Sep 20, 2024
5104ffa
Improve consistency between `type` and `Type` when used as annotation…
brentyi Sep 20, 2024
8f2c05a
Fix helptext formatting edge case (#164)
brentyi Sep 21, 2024
088aa2a
Feature: Markers: SelectionFromEnumValues (#168)
emcd Oct 10, 2024
3b7e37d
Fix `--tyro-write-completion` when `use_underscores=True` (#173)
brentyi Oct 10, 2024
80b1316
Decorator-based subcommand API (#169)
brentyi Oct 10, 2024
2df6aa1
Bump version, fix subcommand example docs/comments
brentyi Oct 11, 2024
4cbf663
Support suppressed arguments with duplicate names + light refactor fo…
brentyi Oct 11, 2024
a867851
Docs fix, gtag
brentyi Oct 11, 2024
34f3b14
Allow subcommand_cli_from_dict to specify console_outputs (#175)
mirceamironenco Oct 11, 2024
8828943
More complete wrappers in `tyro.extras` (for `torchrun`, etc) (#176)
brentyi Oct 11, 2024
3f05503
Fix edge case when combining PEP 695 aliases with `typing.Annotated[]…
brentyi Oct 19, 2024
89ff57a
Fix generic aliases generated by Python 3.12 `type` statements (#179)
brentyi Oct 19, 2024
bd54f77
(refactor) Context-based resolution for generic types (#180)
brentyi Oct 19, 2024
74d977e
`0.8.13`
brentyi Oct 19, 2024
1f76596
Fix example usage commands
brentyi Oct 19, 2024
15c3686
Fix edge cases associated with nested/recursive PEP 695 aliases (#181)
brentyi Oct 22, 2024
1a9448a
Support cyclic generics (#182)
brentyi Oct 22, 2024
b358dfa
Minor helptext generation improvements (#184)
brentyi Oct 23, 2024
ea22883
`typing.Annotated` workaround for pydantic v1 (#187)
brentyi Oct 24, 2024
dd11c77
Primitive handling rewrite (#189)
brentyi Oct 30, 2024
6552337
Start struct handling rewrite (#191)
brentyi Nov 4, 2024
24bbac0
Fix dictionary + numeric tower edge cases introduced by new primitive…
brentyi Nov 4, 2024
42a7f80
Numeric tower improvements + test (#193)
brentyi Nov 5, 2024
663114c
Docs, custom constructor refinements (#194)
brentyi Nov 5, 2024
afd5486
`setuptools` => `hatchling` (#196)
brentyi Nov 6, 2024
afb9636
Rework docs and examples (#198)
brentyi Nov 7, 2024
1065135
Helptext, docs fixes (#199)
brentyi Nov 7, 2024
f150c73
Add test for `typing.Text`
brentyi Nov 10, 2024
b9e72b7
Docs nits
brentyi Nov 11, 2024
13d622e
Support Python 3.13 (#200)
brentyi Nov 13, 2024
5eba34c
More complete custom constructor docs, refinements (#201)
brentyi Nov 16, 2024
3a603a2
Example usage fix
brentyi Nov 16, 2024
91dfac2
`0.9.0`
brentyi Nov 18, 2024
604992e
`0.9.1`, fix build
brentyi Nov 18, 2024
9c5dd26
Apply `use_underscores` to decorator-based subcommand names (#208)
brentyi Nov 22, 2024
ae0ab2c
Less restricted type expansion, more robust subcommand matching, impr…
brentyi Nov 23, 2024
cb79b2a
Fix generic subcommand example doc
brentyi Nov 23, 2024
c195f3a
`0.9.2`
brentyi Nov 23, 2024
af0ae1e
Simplify examples
brentyi Nov 23, 2024
edc2415
Adjust behavior for string types in unions
brentyi Dec 4, 2024
201335e
Test adjustments
brentyi Dec 4, 2024
275431f
Remove forward reference
brentyi Dec 4, 2024
37dc485
ruff
brentyi Dec 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .flake8

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: coverage

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
pip install uv
uv pip install --system -e ".[dev]"
- name: Generate coverage report
run: |
pytest --cov=tyro --cov-report=xml
- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
33 changes: 33 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: docs

on:
push:
branches: [main]

jobs:
docs:
runs-on: ubuntu-latest
steps:
# Check out source
- uses: actions/checkout@v2

# Set up Python
- name: "Set up Python 3.12"
uses: actions/setup-python@v4
with:
python-version: "3.12"

# Build documentation
- name: Building documentation
run: |
pip install uv
uv pip install --system -e ".[dev]"
uv pip install --system -r docs/requirements.txt
sphinx-build docs/source docs/build -b dirhtml

# Deploy
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build
17 changes: 0 additions & 17 deletions .github/workflows/lint.yml

This file was deleted.

21 changes: 8 additions & 13 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,23 @@ name: mypy

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

jobs:
mypy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- name: "Set up Python 3.12"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: "3.12"
- name: Install dependencies
run: |
sudo apt update
python -m pip install --upgrade pip
pip install -e .[type-checking]
pip install uv
uv pip install --system -e ".[dev]"
- name: Test with mypy
run: |
mypy .
mypy --install-types --non-interactive .
39 changes: 21 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflows will upload a Python Package using Twine when a release is created
# This workflows will upload a Python Package using Poetry when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package
Expand All @@ -9,23 +9,26 @@ on:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install uv
uv pip install --system -e ".[dev]"
uv pip install --system build twine
- name: Strip unsupported tags in README
run: |
sed -i '/<!-- pypi-strip -->/,/<!-- \/pypi-strip -->/d' README.md
- name: Build and publish
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine upload --username $PYPI_USERNAME --password $PYPI_PASSWORD dist/*
20 changes: 10 additions & 10 deletions .github/workflows/build.yml → .github/workflows/pyright.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: build
name: pyright

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

jobs:
build:
pyright:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[testing]"
- name: Test with pytest
pip install uv
uv pip install --system -e ".[dev]"
- name: Run pyright
run: |
pytest
pyright .
34 changes: 34 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: pytest

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: matrix.python-version == '3.7'
run: |
pip install --upgrade pip
pip install ".[dev]"
- name: Install dependencies
if: matrix.python-version != '3.7'
run: |
pip install uv
uv pip install --system ".[dev]"
- name: Test with pytest
run: |
pytest
27 changes: 27 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: ruff

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Set up Python 3.10"
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install uv
uv pip install --system -e ".[dev]"
- name: Ruff check
run: |
ruff check --output-format github
- name: Ruff format
run: |
ruff format --diff
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# pyenv and direnv alternative
.rtx.toml
*.swp
*.pyc
*.egg-info
Expand All @@ -8,5 +10,6 @@ __pycache__
.hypothesis
.ipynb_checkpoints
.cache
.coverage
build/
dist/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Brent Yi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading