Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automat: the next generation #137

Merged
merged 233 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
233 commits
Select commit Hold shift + click to select a range
72e3af3
sketch of new type-annotation-based interface
glyph Mar 16, 2022
9a17043
better handling of initial state
glyph Mar 19, 2022
fbd8f7f
alternate implementation strategy
glyph Mar 20, 2022
ec2eab1
explain aspiration for ParamSpec
glyph Mar 20, 2022
da680e5
expose it
glyph Mar 24, 2022
6091ea4
blacken examples
glyph Mar 24, 2022
7fd39d2
clean up first impl, add some notes
glyph Mar 24, 2022
4959aea
literal translation of example
glyph Mar 24, 2022
2a41fc0
mark as typed
glyph May 1, 2022
d712af4
Merge remote-tracking branch 'origin/master' into typical
glyph Jun 10, 2022
ea70a93
the future is now
glyph Jun 11, 2022
6f45213
magically propagate required attributes
glyph Jun 11, 2022
c2a6528
refactoring
glyph Jun 11, 2022
b07cbf8
change lifecycle so that we are instantiating stuff with the right args
glyph Jun 11, 2022
1ad5e58
oh hey we can totally make .build typecheck now that ParamSpec works
glyph Jun 11, 2022
8b06bac
correct implementation of persist flag
glyph Jun 11, 2022
7eac098
CI fixes, version compat
glyph Jun 11, 2022
7370242
Merge remote-tracking branch 'origin/trunk' into typical
glyph Jun 11, 2022
70e23c2
wip
glyph Jun 12, 2022
d622890
fix
glyph Jun 12, 2022
2d0a904
let me see the error codes for more precise type:ignores
glyph Jun 13, 2022
94fbe17
bug workarounds, rip out examples
glyph Jun 13, 2022
bc90112
temporary home for examples
glyph Jun 13, 2022
e7b0dfd
fix up some semantics, do DI for public & private interfaces into states
glyph Jun 13, 2022
2c26e4b
that lives in a different example now
glyph Jun 16, 2022
0d4772e
Merge remote-tracking branch 'origin/trunk' into typical
glyph Jun 16, 2022
deb8b58
Merge remote-tracking branch 'origin/trunk' into typical
glyph Jun 16, 2022
4cc9b79
correct syntax
glyph Jun 16, 2022
85974a3
an test
glyph Jun 16, 2022
ddf8e5b
why is codecov always wrong about everything
glyph Jun 17, 2022
86410ea
some more coverage
glyph Jun 17, 2022
aae0098
increase coverage
glyph Jun 24, 2022
c358c41
test for persistence
glyph Jun 24, 2022
79b5704
test for ephemerality
glyph Jun 25, 2022
3b1b324
tests for state dependency injection via paramters
glyph Jun 25, 2022
804eb76
better test names
glyph Jun 25, 2022
0baf216
dependency on external protocol
glyph Jun 25, 2022
f5eb9ac
remove unused method
glyph Jun 27, 2022
9f9f27d
remove the rest of unnecessary shouldPassSelf complexity
glyph Jun 27, 2022
004af09
private interface tests
glyph Jun 30, 2022
515b653
tests for error states, type-hint-based indication of next state
glyph Jul 1, 2022
afd9c16
oops
glyph Jul 1, 2022
f20f26b
annotation-based interface
glyph Jul 1, 2022
50bdef9
test isinstance
glyph Jul 1, 2022
01f5ab7
hit one other case of dependency injection
glyph Jul 1, 2022
2278385
stuff to ignore
glyph Jul 1, 2022
486f8a9
restructure for coverage-friendliness
glyph Jul 1, 2022
6bbae32
py38
glyph Jul 1, 2022
fa66cb5
3.9
glyph Jul 1, 2022
e4f6bb5
another version-dependent thing
glyph Jul 1, 2022
c4aad32
work on 3.8?
glyph Jul 1, 2022
9dda5a2
remove dead method body
glyph Jul 1, 2022
9e45358
remove unused method
glyph Jul 1, 2022
1d33e7f
remove unused test transition
glyph Jul 1, 2022
fd3d64a
remove unused transition
glyph Jul 1, 2022
4912588
error handling
glyph Jul 1, 2022
e01f3ab
more unused transitions
glyph Jul 1, 2022
79a66c2
Merge branch 'trunk' into typical
glyph Oct 29, 2022
48b277c
Merge branch 'trunk' into typical
glyph Oct 29, 2022
9b188c5
Merge branch 'trunk' into typical
glyph Dec 10, 2022
13a8fae
Merge remote-tracking branch 'origin/trunk' into typical
glyph Sep 11, 2023
8597df7
wip
glyph Dec 9, 2023
3a60f82
try to make this more readable and documented
glyph Dec 9, 2023
95e2470
make inputProtocols frozen (that set should not change!) and rename
glyph Dec 9, 2023
69ce6f4
try to refactor
glyph Dec 9, 2023
cdee161
try to clean this up
glyph Dec 10, 2023
51212d4
almost there...
glyph Dec 10, 2023
b3c182c
all tests passing again
glyph Dec 10, 2023
479bc3e
remove debug prints and take some notes
glyph Dec 10, 2023
dba7550
cleanups
glyph Dec 11, 2023
26d9e8c
blacken
glyph Dec 11, 2023
879e694
more black cleanups
glyph Dec 11, 2023
9466e8f
3.8
glyph Dec 11, 2023
aec8308
nevermind
glyph Dec 11, 2023
7f31f7e
cleanup legacy inheritance
glyph Jul 9, 2024
4d49990
fancy up the types a bit
glyph Jul 9, 2024
1c825db
minor cleanups
glyph Jul 12, 2024
6c67015
fix some bugs and eliminate error-prone .enter mutation
glyph Jul 12, 2024
0f3bbae
consolidate 3.8 conditional
glyph Jul 12, 2024
173c9f2
Merge remote-tracking branch 'origin/trunk' into typical
glyph Jul 12, 2024
5f96d62
just include the version info
glyph Jul 12, 2024
d75cc4d
more compact
glyph Jul 12, 2024
c6b0b4d
update codecov to v4.5.0 to see if we can work around these issues
glyph Jul 12, 2024
58585f3
add the … secret?
glyph Jul 12, 2024
02952c5
fix up enter= parameter test
glyph Jul 12, 2024
7787ac0
tighten up types, write coverage for filtering of input bound args to…
glyph Jul 12, 2024
5dfb4a8
explain what all this stuff is *doing* here
glyph Jul 13, 2024
6ddf1e6
improve legibility of type hints
glyph Jul 13, 2024
c3fdab3
this already worked, but let's record it to be clearer
glyph Jul 13, 2024
a28a62c
make a mess: gobs of debugging, add __automat_post_enter__
glyph Jul 13, 2024
5f90bf8
more debugging, careful re-ordering of __automat_post_enter__ hook
glyph Jul 13, 2024
f94d928
3.8 runtime fix
glyph Jul 13, 2024
f9ee273
clean up print statements
glyph Jul 13, 2024
8c58c1a
actually run mypy please
glyph Jul 13, 2024
29e8c55
mypy fixes
glyph Jul 13, 2024
6cec83a
black
glyph Jul 13, 2024
4d20bfa
everybody's favorite future import
glyph Jul 13, 2024
fefe912
no coverage on lint (why did *that* work before?)
glyph Jul 13, 2024
3321353
versions versions versions
glyph Jul 13, 2024
f3c9ce2
'state core' is confusing, let's call it a 'shared core'
glyph Jul 13, 2024
ac73885
get get_type_hints from typing_extensions on 3.8
glyph Jul 13, 2024
1c784ee
make hint evaluation more consistent
glyph Jul 14, 2024
4b65f1e
type annotations for visualization
glyph Jul 14, 2024
c591936
different future
glyph Jul 14, 2024
30746f8
remove debug print
glyph Jul 14, 2024
c5dc66b
add visualization support for TypicalMachines
glyph Jul 14, 2024
aa51ba1
oops wrong name
glyph Jul 14, 2024
9e42b61
some new wacky ideas that are probably better than what I'm doing in …
glyph Jul 14, 2024
90f9b6e
the third time's the charm
glyph Jul 15, 2024
09caf7b
common-ify more protocol-runtime stuff
glyph Jul 15, 2024
a52de12
a jumble of stuff; upgrade black, add type annotations to core, _typi…
glyph Jul 15, 2024
356be36
enough of a prototype that the example works
glyph Jul 15, 2024
dbdcc3c
some fixes, but not all of them
glyph Jul 15, 2024
09b5f6f
far too many type annotations
glyph Jul 16, 2024
eda0a45
complete prototype
glyph Jul 16, 2024
1ed0eb5
debugging, type hints
glyph Jul 16, 2024
9ba187a
more fixups
glyph Jul 16, 2024
a5be459
broken, explain
glyph Jul 16, 2024
7073c8a
remove this type-hint-testing thing
glyph Jul 22, 2024
c2ed21e
briefer annotation using Decorator[] hint
glyph Jul 22, 2024
ffe13f8
re-wrap
glyph Jul 22, 2024
829b320
conditional imports for <3.10 support, back to green
glyph Jul 22, 2024
ec9ee05
black
glyph Jul 22, 2024
cdb028c
re-adopt Decorator for brevity
glyph Jul 22, 2024
d361986
clear out debug prints
glyph Jul 24, 2024
5beaf35
add convenience methods to make things shorter
glyph Jul 26, 2024
d15b275
.to().upon() interface to replace .transition
glyph Jul 27, 2024
71d84fa
test fixes
glyph Jul 27, 2024
9a2c192
black
glyph Jul 27, 2024
1d5732b
avoid problems with version skew by not parsing signature
glyph Jul 27, 2024
ccc7126
add explicit pep614 workaround
glyph Jul 28, 2024
cc6e1a0
add visualization, port over example, get rid of now-defunct _typical…
glyph Jul 28, 2024
4391ae9
stray comment
glyph Jul 28, 2024
63c9669
remove debug print
glyph Jul 28, 2024
d595b8c
fix up turnstile example
glyph Jul 28, 2024
c7fbc1f
make before/after as clear a contrast as possible
glyph Jul 28, 2024
c6e2552
small adjustments
glyph Jul 28, 2024
195a176
missing return-type annotations
glyph Jul 28, 2024
0018fd2
update to current API
glyph Jul 28, 2024
17554df
more types
glyph Jul 29, 2024
494e89a
cleanups, renaming
glyph Jul 29, 2024
4f74c65
first test for TypeMachineBuilder interface
glyph Jul 30, 2024
1822348
move test protocol state machine to module scope for visualization an…
glyph Jul 30, 2024
5fdb442
make sure that we don't persist the state-specific data across a tran…
glyph Jul 30, 2024
71be582
debugging aid: warn users when they forget to fully declare a transition
glyph Jul 30, 2024
a3b1f9e
test data-state to data-state transition
glyph Jul 30, 2024
0487f15
stricter / more correct FactoryParams match verification
glyph Jul 30, 2024
b5a7966
inverse argument check
glyph Jul 30, 2024
bd1c99b
warn on unused ignores
glyph Jul 30, 2024
436bd5c
same semantics but different implication; let's not use FactoryParams…
glyph Jul 30, 2024
6669e04
add defaults to illustrate signature-match problem
glyph Jul 30, 2024
782abe2
reverse method chain invocation order to deal with ParamSpec variance
glyph Jul 31, 2024
c92b52e
reverse to/upon ordering in tests, which now fail
glyph Jul 31, 2024
38dfc7d
same update in examples
glyph Jul 31, 2024
f88a985
add back 'dataless()' in the form of 'nodata'
glyph Jul 31, 2024
0986731
old Python versions
glyph Jul 31, 2024
dc3ec98
oops now mypy is configured to warn on unused ignores
glyph Jul 31, 2024
6c5d88e
explicitly test reentrancy
glyph Jul 31, 2024
fac3971
remove some dead code
glyph Jul 31, 2024
a5ea7b0
test for type machine discovery
glyph Jul 31, 2024
2388da9
visualization test cases
glyph Jul 31, 2024
03173df
black
glyph Jul 31, 2024
b24f303
minor coverage tweaks
glyph Jul 31, 2024
c8f2df9
these are tests for code that shouldn't be run, so annotate them as such
glyph Jul 31, 2024
77ffcb3
NoTransition test
glyph Jul 31, 2024
5b7175c
test coverage for unhandledTransition
glyph Jul 31, 2024
948cae9
add future-annotations import to stringify some stuff
glyph Jul 31, 2024
de9156e
Sequence[Output]
glyph Jul 31, 2024
1bb0295
eliminate code that is possibly vestigial from python2
glyph Jul 31, 2024
b818a34
black
glyph Jul 31, 2024
113af0b
consistent state names
glyph Aug 1, 2024
c5d9a19
fix method ordering
glyph Aug 1, 2024
826f126
start switching over from coffee-machine as initial example to garage…
glyph Aug 1, 2024
c338274
outline new docs
glyph Aug 2, 2024
0c1168d
missing garage door example
glyph Aug 2, 2024
cc240a8
states must be hashable
glyph Aug 10, 2024
d921e3d
make stuff hashable, remove flailing ', /,' callable-compatibility hacks
glyph Aug 10, 2024
df9935f
better visualization than <lambda>
glyph Aug 10, 2024
16eeab9
no more attrs
glyph Aug 10, 2024
7f90379
dataclasses are more than sufficient, drop attrs dep
glyph Aug 10, 2024
1937517
augment machine fixture to include test expectation
glyph Aug 10, 2024
5e2ffcb
oops, missed a spot
glyph Aug 10, 2024
6acab9e
build safety tests
glyph Aug 11, 2024
ef53493
method membership safety check
glyph Aug 11, 2024
e5b33be
remove debug print
glyph Aug 11, 2024
7038571
unused type variables
glyph Aug 11, 2024
76b9641
more consistent camelCase, explicit catch for invalid deserialization…
glyph Aug 15, 2024
b66c2da
black, precisely target arg-type ignore
glyph Aug 15, 2024
3c57f2d
support zope.interface
glyph Aug 15, 2024
471e7bc
refactor to avoid metaclass shenanigans
glyph Aug 15, 2024
1ba8a41
clean up invalid-state initialization path for readability
glyph Aug 15, 2024
c5159af
black
glyph Aug 15, 2024
6cf3088
clean up registrars, inline method namespace
glyph Aug 15, 2024
20f1a79
test-module coverage notes
glyph Aug 15, 2024
7d8f421
test for 'data:' prefix
glyph Aug 15, 2024
36b6e74
minor naming fixes
glyph Aug 15, 2024
8671f3e
return type annotation
glyph Aug 15, 2024
42edb4d
increased type precision
glyph Aug 15, 2024
381c4ae
even more type specificity
glyph Aug 15, 2024
e3fac2c
naming updates
glyph Aug 15, 2024
8b01ddd
okay nevermind with autodoc, it's just not good enough at documenting…
glyph Aug 15, 2024
a0c57c2
include docs environment
glyph Aug 15, 2024
6e939dc
blacken
glyph Aug 15, 2024
4b086d1
add pydoctor dep
glyph Aug 15, 2024
130abc8
-u
glyph Aug 15, 2024
ee7e68c
not sure if this is the right way to link back to the docs but it see…
glyph Aug 15, 2024
25c2388
various epytext fixes
glyph Aug 15, 2024
ec7fc05
install graphviz to cover code
glyph Aug 15, 2024
081081a
quotes
glyph Aug 15, 2024
7a99438
remove unnecessary initializingData safeguard that is now handled by …
glyph Aug 15, 2024
a43b3df
cover assertion about generic
glyph Aug 15, 2024
1b7205c
coverage gaps
glyph Aug 15, 2024
76aeee4
blacken
glyph Aug 15, 2024
ae78fe7
move generic so _liveSignature can work, for test coverage
glyph Aug 15, 2024
db22144
elide body for coverage
glyph Aug 15, 2024
771b429
rename to avoid pytest warning
glyph Aug 15, 2024
142bb59
get a picture of skips
glyph Aug 15, 2024
8799c41
correct option
glyph Aug 15, 2024
a810e6f
not interesting to cover this code
glyph Aug 15, 2024
35fedb4
type annotation and spread out implementation to see if it's crashing
glyph Aug 15, 2024
068bddb
typified -> typed
glyph Aug 16, 2024
5679b6b
documentation
glyph Aug 16, 2024
961e19e
fix toctree
glyph Aug 16, 2024
af99914
words words words
glyph Aug 16, 2024
0169379
all the documentation
glyph Aug 17, 2024
f8f4a39
readthedocs config file as required
glyph Aug 17, 2024
437eb08
update README and add note
glyph Aug 17, 2024
c6cadca
harmonize with readthedocs
glyph Aug 17, 2024
e806c2a
harmonize with makefile
glyph Aug 17, 2024
41aa5bf
README fix
glyph Aug 17, 2024
d9d1b98
documentatione
glyph Aug 17, 2024
a0dfc96
remove old typing doc
glyph Aug 17, 2024
77787f3
remove debugging docs, index entries
glyph Aug 17, 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
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[report]
precision = 2
ignore_errors = True
exclude_lines =
pragma: no cover
if TYPE_CHECKING
\s*\.\.\.$
raise NotImplementedError
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.10", "3.11"]
python: ["3.8", "3.10", "3.11"]
TOX_ENV: ["extras", "noextras", "mypy"]
include:
- python: "3.11"
Expand All @@ -28,17 +28,24 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install graphviz
run: |
sudo apt-get install -y graphviz
dot -V
if: ${{ matrix.TOX_ENV == 'extras' }}
- name: Tox Run
run: |
pip install tox;
TOX_ENV="py$(echo ${{ matrix.python }} | sed -e s/\.//g)-${{ matrix.TOX_ENV }}";
TOX_ENV="py$(echo ${{ matrix.python }} | sed -e 's/\.//g')-${{ matrix.TOX_ENV }}";
echo "Starting: ${TOX_ENV} ${PUSH_DOCS}"
if [[ -n "${TOX_ENV}" ]]; then
tox -e "$TOX_ENV";
if [[ "${{ matrix.TOX_ENV }}" != "mypy" ]]; then
if [[ "${{ matrix.TOX_ENV }}" != "mypy" && "${{ matrix.TOX_ENV }}" != "lint" ]]; then
tox -e coverage-report;
fi;
fi;
- name: Upload coverage report
if: ${{ matrix.TOX_ENV != 'mypy' }}
uses: codecov/[email protected]
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.tox/
.coverage*
.coverage.*
.eggs/
*.egg-info/
*.py[co]
build/
dist/
docs/_build/
coverage.xml

23 changes: 23 additions & 0 deletions .pydoctor.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[tool:pydoctor]
quiet=1
warnings-as-errors=true
project-name=Automat
project-url=../index.html
docformat=epytext
theme=readthedocs
intersphinx=
https://graphviz.readthedocs.io/en/stable/objects.inv
https://docs.python.org/3/objects.inv
https://cryptography.io/en/latest/objects.inv
https://pyopenssl.readthedocs.io/en/stable/objects.inv
https://hyperlink.readthedocs.io/en/stable/objects.inv
https://twisted.org/constantly/docs/objects.inv
https://twisted.org/incremental/docs/objects.inv
https://python-hyper.org/projects/hyper-h2/en/stable/objects.inv
https://priority.readthedocs.io/en/stable/objects.inv
https://zopeinterface.readthedocs.io/en/latest/objects.inv
https://automat.readthedocs.io/en/latest/objects.inv
https://docs.twisted.org/en/stable/objects.inv
project-base-dir=automat
html-output=docs/_build/api
html-viewsource-base=https://github.com/glyph/automat/tree/trunk
35 changes: 35 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
Loading
Loading