Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
608 commits
Select commit Hold shift + click to select a range
f3eeecd
Set stale unique records to expire 1s in the future instead of instan…
bdraco Jun 17, 2021
c366c8c
Synchronize created time for incoming and outgoing queries (#709)
bdraco Jun 17, 2021
aeb1b23
Add setter for DNSQuestion to easily make a QU question (#710)
bdraco Jun 17, 2021
6b923de
Cleanup typing in zeroconf._services.registry (#712)
bdraco Jun 17, 2021
a42512c
Cleanup typing in zeroconf._services (#711)
bdraco Jun 17, 2021
a50b3ee
Cleanup typing in zeroconf._utils.net (#713)
bdraco Jun 17, 2021
3fcdcfd
Cleanup typing in zeroconf._logger (#715)
bdraco Jun 17, 2021
0f2f4e2
Update README (#716)
bdraco Jun 17, 2021
8183640
Cleanup typing in zero._core and document ignores (#714)
bdraco Jun 17, 2021
1ab6859
Update changelog (#717)
bdraco Jun 17, 2021
18ddb8d
Synchronize time for fate sharing (#718)
bdraco Jun 17, 2021
e2d4d98
Relocate cache tests to tests/test_cache.py (#722)
bdraco Jun 18, 2021
3338594
Fix ServiceInfo with multiple A records (#725)
bdraco Jun 18, 2021
f91af79
Rename handlers and internals to make it clear what is threadsafe (#726)
bdraco Jun 18, 2021
9cc834d
Update changelog (#727)
bdraco Jun 18, 2021
ceb79bd
Add tests for the DNSCache class (#728)
bdraco Jun 18, 2021
88aa610
Fix cache handling of records with different TTLs (#729)
bdraco Jun 18, 2021
3503e76
Prefix cache functions that are non threadsafe with async_ (#724)
bdraco Jun 18, 2021
733f79d
Update changelog (#730)
bdraco Jun 18, 2021
3ee9b65
Fix server cache to be case-insensitive (#731)
bdraco Jun 18, 2021
50af944
Add test coverage to ensure the cache flush bit is properly handled (…
bdraco Jun 19, 2021
c035925
Switch to using DNSRRSet in RecordManager (#735)
bdraco Jun 19, 2021
9d31245
Add fast cache lookup functions (#732)
bdraco Jun 19, 2021
35ac7a3
Breakout ServiceBrowser handler from listener creation (#736)
bdraco Jun 19, 2021
5feda7e
Remove second level caching from ServiceBrowsers (#737)
bdraco Jun 19, 2021
e227d6e
Fix flakey cache bit flush test (#739)
bdraco Jun 19, 2021
c8e15dd
Run question answer callbacks from add_listener in the event loop (#740)
bdraco Jun 19, 2021
f0d727b
Relocate ServiceInfo to zeroconf._services.info (#741)
bdraco Jun 19, 2021
368163d
Relocate ServiceBrowser to zeroconf._services.browser (#744)
bdraco Jun 19, 2021
869c95a
Relocate service browser tests to tests/services/test_browser.py (#745)
bdraco Jun 19, 2021
541292e
Relocate service info tests to tests/services/test_info.py (#746)
bdraco Jun 19, 2021
0909c80
Update changelog (#747)
bdraco Jun 19, 2021
7b3b4b5
Remove support for notify listeners (#733)
bdraco Jun 19, 2021
0dbcabf
Run ServiceInfo requests in the event loop (#748)
bdraco Jun 19, 2021
0f702c6
Update async_service_info_request example to ensure it runs in the ri…
bdraco Jun 19, 2021
3b9baf0
Fix warning about Zeroconf._async_notify_all not being awaited in syn…
bdraco Jun 19, 2021
e7adce2
Remove unused argument from AsyncZeroconf (#751)
bdraco Jun 19, 2021
4d0a8f3
Run ServiceBrowser queries in the event loop (#752)
bdraco Jun 19, 2021
04cd268
Drop AsyncServiceListener (#754)
bdraco Jun 19, 2021
f53c88b
Revert: Fix thread safety in _ServiceBrowser.update_records_complete …
bdraco Jun 19, 2021
f24ebba
Simplify ServiceBrowser callsbacks (#756)
bdraco Jun 20, 2021
1c93baa
Update changelog (#757)
bdraco Jun 20, 2021
9f68fc8
Add missing coverage for SignalRegistrationInterface (#758)
bdraco Jun 20, 2021
936500a
Add 60s timeout for each test (#761)
bdraco Jun 20, 2021
fc0e599
Fix race condition in ServiceBrowser test_integration (#762)
bdraco Jun 20, 2021
38b59a6
Fix test_lots_of_names overflowing the incoming buffer (#763)
bdraco Jun 20, 2021
85532e1
Break test_lots_of_names into two tests (#764)
bdraco Jun 20, 2021
6c82fa9
Switch to using an asyncio.Event for async_wait (#759)
bdraco Jun 20, 2021
e70431e
Add test coverage to ensure RecordManager.add_listener callsback know…
bdraco Jun 20, 2021
5d44a36
Improve performance of parsing DNSIncoming by caching read_utf (#769)
bdraco Jun 20, 2021
b600547
Implement accidental synchronization protection (RFC2762 section 5.2)…
bdraco Jun 20, 2021
f23df4f
Verify async callers can still use Zeroconf without migrating to Asyn…
bdraco Jun 20, 2021
e8836b1
Add a guard against the task list changing when shutting down (#776)
bdraco Jun 20, 2021
b5d54e4
Fix deadlock on ServiceBrowser shutdown with PyPy (#774)
bdraco Jun 20, 2021
c0f4f48
Implement duplicate question supression (#770)
bdraco Jun 20, 2021
ac9f72a
Fix Responding to Address Queries (RFC6762 section 6.2) (#777)
bdraco Jun 21, 2021
767ae8f
Reformat test_handlers (#780)
bdraco Jun 21, 2021
7aeafbf
Switch to using a simple cache instead of lru_cache (#779)
bdraco Jun 21, 2021
1b87343
Drop utf cache from _dns (#781)
bdraco Jun 21, 2021
3be1bc8
Inline utf8 decoding when processing incoming packets (#782)
bdraco Jun 21, 2021
dd85ae7
Add a guard to prevent running ServiceInfo.request in async context (…
bdraco Jun 21, 2021
97f5b50
Ensure the queue is created before adding listeners to ServiceBrowser…
bdraco Jun 21, 2021
3b3ecf0
Update changelog (#786)
bdraco Jun 21, 2021
135983c
Add support for requesting QU questions to ServiceBrowser and Service…
bdraco Jun 21, 2021
62dc9c9
Add async_apple_scanner example (#719)
bdraco Jun 21, 2021
5d23628
Update changelog (#788)
bdraco Jun 21, 2021
ecad4e8
Ensure outgoing ServiceBrowser questions are seen by the question his…
bdraco Jun 21, 2021
6aac0eb
Fix test_tc_bit_defers_last_response_missing failures due to thread s…
bdraco Jun 21, 2021
2bfbcbe
Make add_listener and remove_listener threadsafe (#794)
bdraco Jun 21, 2021
cb91484
Remove unused constant from zeroconf._handlers (#796)
bdraco Jun 21, 2021
d637d67
Pass both the new and old records to async_update_records (#792)
bdraco Jun 21, 2021
c36099a
Update changelog (#797)
bdraco Jun 21, 2021
38e66ec
Ensure fresh ServiceBrowsers see old_record as None when replaying th…
bdraco Jun 21, 2021
9961dce
Update changelog (#798)
bdraco Jun 21, 2021
bbc9124
Ensure we handle threadsafe shutdown under PyPy with multiple event l…
bdraco Jun 21, 2021
662ed61
Update changelog (#801)
bdraco Jun 21, 2021
58ae3cf
Update changelog (#802)
bdraco Jun 21, 2021
18fe341
Add slots to DNS classes (#803)
bdraco Jun 21, 2021
df66da2
Skip network adapters that are disconnected (#327)
ZLJasonG Jun 22, 2021
59e4bd2
Update changelog (#804)
bdraco Jun 22, 2021
5dccf34
Tag 0.32.0b3 (#805)
bdraco Jun 22, 2021
05bb21b
Qualify IPv6 link-local addresses with scope_id (#343)
ibygrave Jun 22, 2021
0129ac0
Format tests/services/test_info.py with newer black (#809)
bdraco Jun 22, 2021
f9bbbce
Make DNSHinfo and DNSAddress use the same match order as DNSPointer a…
bdraco Jun 22, 2021
d4c8f0d
Simplify wait_event_or_timeout (#810)
bdraco Jun 22, 2021
13c558c
Update changelog (#811)
bdraco Jun 22, 2021
e32bb5d
New ServiceBrowsers now request QU in the first outgoing when unspeci…
bdraco Jun 22, 2021
ffd2532
Turn on logging in the types test (#816)
bdraco Jun 22, 2021
f9d3529
Fix default v6_flow_scope argument with tests that mock send (#819)
bdraco Jun 22, 2021
a7b4f8e
Fix reliablity of tests that patch sending (#820)
bdraco Jun 23, 2021
4062fe2
Only wake up the query loop when there is a change in the next query …
bdraco Jun 23, 2021
4a82769
Update changelog (#822)
bdraco Jun 23, 2021
7f6d003
Guard against excessive ServiceBrowser queries from PTR records signi…
bdraco Jun 23, 2021
6298ef9
Drop oversize packets before processing them (#826)
bdraco Jun 23, 2021
82f80c3
Update changelog (#827)
bdraco Jun 23, 2021
4c4b388
Convert test_integration to asyncio to avoid testing threading races …
bdraco Jun 25, 2021
10f4a7f
Disable duplicate question suppression for test_integration (#830)
bdraco Jun 25, 2021
8230e3f
Show 20 slowest tests on each run (#832)
bdraco Jun 25, 2021
4039b0b
Annotate test failures on github (#831)
bdraco Jun 25, 2021
0bf4f75
Cache dependency installs in CI (#833)
bdraco Jun 25, 2021
540c652
Wait for startup in test_integration (#834)
bdraco Jun 25, 2021
0b1abbc
Ensure coverage.xml is written for codecov (#837)
bdraco Jun 25, 2021
7297f3e
Make multipacket known answer suppression per interface (#836)
bdraco Jun 25, 2021
3fdd834
Adjust restore key for CI cache (#838)
bdraco Jun 25, 2021
937be52
Skip dependencies install in CI on cache hit (#839)
bdraco Jun 25, 2021
7fb11bf
Limit duplicate packet suppression to 1s intervals (#841)
bdraco Jun 26, 2021
ecd9c94
Fix ineffective patching on PyPy (#842)
bdraco Jun 26, 2021
688c518
Use AAAA records instead of A records in test_integration_with_listen…
bdraco Jun 26, 2021
dd86f2f
Increase timeout in test_integration (#844)
bdraco Jun 26, 2021
72502c3
Update changelog (#845)
bdraco Jun 26, 2021
182c68f
Fix thread safety in handlers test (#847)
bdraco Jun 27, 2021
9f71e5b
Fix spurious failures in ZeroconfServiceTypes tests (#848)
bdraco Jun 27, 2021
a8c1623
Switch ServiceBrowser query scheduling to use call_later instead of a…
bdraco Jun 27, 2021
8c9d1d8
Update changelog (#850)
bdraco Jun 27, 2021
76e0b05
Make ServiceInfo first question QU (#852)
bdraco Jun 27, 2021
0cd876f
Speed up test_verify_name_change_with_lots_of_names under PyPy (#853)
bdraco Jun 27, 2021
03411f3
Only run linters on Linux in CI (#855)
bdraco Jun 27, 2021
cb2e237
Update changelog (#856)
bdraco Jun 27, 2021
59247f1
Fix changelog formatting (#857)
bdraco Jun 27, 2021
3eb7be9
Cleanup coverage data (#858)
bdraco Jun 28, 2021
57cccc4
Make a dispatch dict for ServiceStateChange listeners (#859)
bdraco Jun 28, 2021
af83c76
Add unit coverage for shutdown_loop (#860)
bdraco Jun 28, 2021
f536869
Remove unreachable code in AsyncListener.datagram_received (#863)
bdraco Jun 28, 2021
c516919
Ensure protocol and sending errors are logged once (#862)
bdraco Jun 28, 2021
c64064a
Update changelog (#864)
bdraco Jun 28, 2021
6ef65fc
Add test coverage for duplicate properties in a TXT record (#865)
bdraco Jun 28, 2021
dcf18c8
Add test coverage to ensure ServiceBrowser ignores unrelated updates …
bdraco Jun 28, 2021
22ff6b5
Break apart new_socket to be testable (#867)
bdraco Jun 28, 2021
4ed9036
Fix deadlock when event loop is shutdown during service registration …
bdraco Jun 28, 2021
972da99
Update changelog (#870)
bdraco Jun 28, 2021
471bacd
Add coverage to ensure unrelated A records do not generate ServiceBro…
bdraco Jun 29, 2021
decd8a2
Fix flapping test test_integration_with_listener_class (#876)
bdraco Jun 29, 2021
f0770fe
Break apart net_socket for easier testing (#875)
bdraco Jun 29, 2021
ab83819
Add coverge for disconnected adapters in add_multicast_member (#877)
bdraco Jun 29, 2021
86e2ab9
Add coverage to ensure loading zeroconf._logger does not override log…
bdraco Jun 29, 2021
be1d3bb
Update changelog (#879)
bdraco Jun 29, 2021
b9eae5a
Revert name change of zeroconf.asyncio to zeroconf.aio (#885)
bdraco Jun 29, 2021
b9dc12d
Disable pylint in the CI (#886)
bdraco Jun 29, 2021
14cf936
Collapse changelog for 0.32.0 (#887)
bdraco Jun 29, 2021
d31fd10
Remove extra newlines between changelog entries (#888)
bdraco Jun 29, 2021
9abb40c
Reformat backwards incompatible changes to match previous versions (#…
bdraco Jun 29, 2021
0d91156
Rewrite 0.32.0 changelog in past tense (#890)
bdraco Jun 29, 2021
ba235dd
Fix spelling and grammar errors in 0.32.0 changelog (#891)
bdraco Jun 29, 2021
34f6e49
Reformat changelog to match prior versions (#892)
bdraco Jun 29, 2021
ea7bc85
Release version 0.32.0
jstasiak Jun 30, 2021
82ff150
Fix readme formatting
jstasiak Jun 30, 2021
90bc8ca
Add test for running sync code within executor (#894)
jacobtomlinson Jul 4, 2021
56c7d69
Increase timeout in ServiceInfo.request to handle loaded systems (#895)
bdraco Jul 4, 2021
a93301d
Update changelog (#899)
bdraco Jul 4, 2021
fc089be
Fix the changelog's one sentence's tense
jstasiak Jul 5, 2021
675fd6f
Release version 0.32.1
jstasiak Jul 5, 2021
f8af0fb
Disable N818 in flake8 (#905)
bdraco Jul 16, 2021
e417fc0
Reduce duplicate code between zeroconf.asyncio and zeroconf._core (#904)
bdraco Jul 16, 2021
9399c57
Centralize running coroutines from threads (#906)
bdraco Jul 16, 2021
bc9e9cf
Implement NSEC record parsing (#903)
bdraco Jul 16, 2021
0578731
Upgrade syntax to python 3.6 (#907)
bdraco Jul 16, 2021
69942d5
Rename DNSNsec.next to DNSNsec.next_name (#908)
bdraco Jul 16, 2021
e63ca51
Remove duplicate unregister_all_services code (#910)
bdraco Jul 17, 2021
2d3da7a
Remove locking from ServiceRegistry (#911)
bdraco Jul 17, 2021
b2a7a00
Update changelog for 0.33.0 (#912)
bdraco Jul 17, 2021
38eb271
Switch periodic cleanup task to call_later (#913)
bdraco Jul 17, 2021
aa71084
Remove Zeroconf.wait as its now unused in the codebase (#914)
bdraco Jul 17, 2021
b6eaf72
Reduce complexity of DNSRecord (#915)
bdraco Jul 18, 2021
919b096
Let connection_lost close the underlying socket (#918)
bdraco Jul 19, 2021
96be961
Update changelog for 0.33.0 release (#919)
bdraco Jul 19, 2021
2e00002
Add support for bump2version (#920)
bdraco Jul 19, 2021
b0b23f9
Fix examples/async_registration.py attaching to the correct loop (#921)
bdraco Jul 19, 2021
e4a9655
Update changelog for 0.33.0 release (#922)
bdraco Jul 19, 2021
cfb28aa
Bump version: 0.32.1 → 0.33.0
bdraco Jul 19, 2021
ed80333
Update changelog for 0.33.1 (#924)
bdraco Jul 19, 2021
6774de3
Bump version: 0.33.0 → 0.33.1
bdraco Jul 19, 2021
1247acd
Remove some pylint workarounds (#925)
bdraco Jul 22, 2021
73e3d18
Skip ipv6 interfaces that return ENODEV (#930)
bdraco Jul 28, 2021
97e0b66
Handle duplicate goodbye answers in the same packet (#928)
bdraco Jul 28, 2021
c80b5f7
Update changelog for 0.33.2 (#931)
bdraco Jul 28, 2021
4d30c25
Bump version: 0.33.1 → 0.33.2
bdraco Jul 28, 2021
319992b
Provide sockname when logging a protocol error (#935)
bdraco Aug 5, 2021
5682a4c
Add support for forward dns compression pointers (#934)
bdraco Aug 5, 2021
6a140cc
Update changelog for 0.33.3 (#936)
bdraco Aug 5, 2021
206671a
Bump version: 0.33.2 → 0.33.3
bdraco Aug 5, 2021
496ac44
Ensure zeroconf can be loaded when the system disables IPv6 (#933)
che0 Aug 6, 2021
858605d
Update changelog for 0.33.4 (#937)
bdraco Aug 6, 2021
7bbacd5
Bump version: 0.33.3 → 0.33.4
bdraco Aug 6, 2021
55efb41
Implement Multicast Response Aggregation (#940)
bdraco Aug 8, 2021
342532e
Update changelog for 0.34.0 (#941)
bdraco Aug 8, 2021
549ac3d
Bump version: 0.33.4 → 0.34.0
bdraco Aug 8, 2021
de96e2b
Ensure multicast aggregation sends responses within 620ms (#942)
bdraco Aug 9, 2021
9942484
Update changelog for 0.34.1 (#943)
bdraco Aug 9, 2021
7878a9e
Bump version: 0.34.0 → 0.34.1
bdraco Aug 9, 2021
9a5164a
Coalesce aggregated multicast answers when the random delay is shorte…
bdraco Aug 9, 2021
6d7266d
Ensure ServiceInfo requests can be answered with the default timeout …
bdraco Aug 9, 2021
b87f493
Update changelog for 0.34.2 (#947)
bdraco Aug 9, 2021
6c21f68
Bump version: 0.34.1 → 0.34.2
bdraco Aug 9, 2021
02af7f7
Fix sending immediate multicast responses (#949)
bdraco Aug 9, 2021
23b00e9
Update changelog for 0.34.3 (#950)
bdraco Aug 9, 2021
9d69d18
Bump version: 0.34.2 → 0.34.3
bdraco Aug 9, 2021
ebc23ee
Sort responses to increase chance of name compression (#954)
bdraco Aug 13, 2021
5fb3e20
Send unicast replies on the same socket the query was received (#952)
bdraco Aug 13, 2021
c772936
Reduce chance of accidental synchronization of ServiceInfo requests (…
bdraco Aug 13, 2021
dd40437
Update changelog for 0.35.0 (#957)
bdraco Aug 13, 2021
1e60e13
Bump version: 0.34.3 → 0.35.0
bdraco Aug 13, 2021
7b125a1
Only reschedule types if the send next time changes (#958)
bdraco Aug 15, 2021
2d1b832
Add coverage for sending answers removes future queued answers (#961)
bdraco Aug 15, 2021
3b482e2
Fix flakey test: test_future_answers_are_removed_on_send (#962)
bdraco Aug 15, 2021
d4c109c
Cache DNS record and question hashes (#960)
bdraco Aug 15, 2021
f7bebfe
Update changelog for 0.35.1 (#963)
bdraco Aug 15, 2021
c7c7d47
Fix formatting in 0.35.1 changelog entry (#964)
bdraco Aug 15, 2021
4281221
Bump version: 0.35.0 → 0.35.1
bdraco Aug 15, 2021
733eb3a
Create full IPv6 address tuple to enable service discovery on Windows…
lokesh2019 Aug 16, 2021
bc50bce
Update changelog for 0.36.0 (#966)
bdraco Aug 16, 2021
e4985c7
Bump version: 0.35.1 → 0.36.0
bdraco Aug 16, 2021
574e241
Fix equality and hash for dns records with the unique bit (#969)
bdraco Aug 29, 2021
d9d3208
Skip goodbye packets for addresses when there is another service regi…
bdraco Aug 29, 2021
d504333
Update changelog for 0.36.1 (#970)
bdraco Aug 29, 2021
e8d8401
Bump version: 0.36.0 → 0.36.1
bdraco Aug 29, 2021
768a23c
Add support for writing NSEC records (#971)
bdraco Aug 29, 2021
7a20fd3
Include NSEC records for non-existant types when responding with addr…
bdraco Aug 30, 2021
b4efa33
Update changelog for 0.36.2 (#973)
bdraco Aug 30, 2021
5f52438
Bump version: 0.36.1 → 0.36.2
bdraco Aug 30, 2021
78f9cd5
Reduce DNSIncoming parsing overhead (#975)
bdraco Sep 14, 2021
84f16bf
Update changelog for 0.36.3 (#977)
bdraco Sep 14, 2021
769b397
Bump version: 0.36.2 → 0.36.3
bdraco Sep 14, 2021
f1d6fc3
Reduce name compression overhead and complexity (#978)
bdraco Sep 16, 2021
d9ea918
Force CI cache clear (#982)
bdraco Sep 16, 2021
acf6457
Reduce duplicate code to write records (#979)
bdraco Sep 16, 2021
bc64d63
Remove flake8 requirement restriction as its no longer needed (#981)
bdraco Sep 16, 2021
05c4329
Collapse _GLOBAL_DONE into done (#984)
bdraco Sep 16, 2021
88b9875
Defer decoding known answers until needed (#983)
bdraco Sep 16, 2021
f4d4164
Update changelog for 0.36.4 (#985)
bdraco Sep 16, 2021
a23f6d2
Bump version: 0.36.3 → 0.36.4
bdraco Sep 16, 2021
4398538
Fix typo in changelog (#986)
bdraco Sep 16, 2021
f4665fc
Reduce dns protocol attributes and add slots (#987)
bdraco Sep 19, 2021
87b6a32
Seperate zeroconf._protocol into an incoming and outgoing modules (#988)
bdraco Sep 19, 2021
aebabe9
Update changelog for 0.36.5 (#989)
bdraco Sep 19, 2021
34f4a26
Bump version: 0.36.4 → 0.36.5
bdraco Sep 19, 2021
1887c55
Simplify the can_send_to check (#990)
bdraco Sep 19, 2021
92f5f4a
Update changelog for 0.36.6 (#991)
bdraco Sep 19, 2021
29f995f
Fix tense of 0.36.6 changelog (#992)
bdraco Sep 19, 2021
0327a06
Bump version: 0.36.5 → 0.36.6
bdraco Sep 19, 2021
93ddf7c
Flush CI cache (#995)
bdraco Sep 22, 2021
7622365
Refactor service registry to avoid use of getattr (#996)
bdraco Sep 23, 2021
7fa51de
Reduce overhead to compare dns records (#997)
bdraco Sep 23, 2021
7df7e4a
Reduce logging overhead (#994)
bdraco Sep 23, 2021
b637846
Improve log message when receiving an invalid or corrupt packet (#998)
bdraco Sep 23, 2021
d2853c3
Update changelog for 0.36.7 (#999)
bdraco Sep 23, 2021
f44b40e
Bump version: 0.36.6 → 0.36.7
bdraco Sep 23, 2021
8e45ea9
Remove unused code in zeroconf._core (#1001)
bdraco Sep 23, 2021
d3ed691
Use more f-strings in zeroconf._dns (#1002)
bdraco Sep 23, 2021
af4d082
Breakout functions with no self-use in zeroconf._handlers (#1003)
bdraco Sep 23, 2021
543558d
Cleanup typing in zeroconf._protocol.outgoing (#1000)
bdraco Sep 23, 2021
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
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[report]
exclude_lines =
pragma: no cover
if TYPE_CHECKING:
if sys.version_info
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- "**"

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9, pypy3]
include:
- os: ubuntu-latest
venvcmd: . env/bin/activate
- os: macos-latest
venvcmd: . env/bin/activate
- os: windows-latest
venvcmd: env\Scripts\Activate.ps1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
id: cache
with:
path: env
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/Makefile') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m venv env
${{ matrix.venvcmd }}
pip install --upgrade -r requirements-dev.txt pytest-github-actions-annotate-failures
- name: Run flake8
if: ${{ runner.os == 'Linux' && matrix.python-version != 'pypy3' }}
run: |
${{ matrix.venvcmd }}
make flake8
- name: Run mypy
if: ${{ runner.os == 'Linux' && matrix.python-version != 'pypy3' }}
run: |
${{ matrix.venvcmd }}
make mypy
- name: Run black_check
if: ${{ runner.os == 'Linux' && matrix.python-version != 'pypy3' }}
run: |
${{ matrix.venvcmd }}
make black_check
- name: Run tests
run: |
${{ matrix.venvcmd }}
make test_coverage
- name: Report coverage to Codecov
uses: codecov/codecov-action@v1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ Thumbs.db
.cache
.mypy_cache/
docs/_build/
.vscode
/dist/
/zeroconf.egg-info/
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

24 changes: 14 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,49 +1,53 @@
# version: 1.1

.PHONY: all virtualenv
MAX_LINE_LENGTH=110
PYTHON_IMPLEMENTATION:=$(shell python -c "import sys;import platform;sys.stdout.write(platform.python_implementation())")
PYTHON_VERSION:=$(shell python -c "import sys;sys.stdout.write('%d.%d' % sys.version_info[:2])")
TEST_ARGS=

LINT_TARGETS:=flake8

ifneq ($(findstring PyPy,$(PYTHON_IMPLEMENTATION)),PyPy)
LINT_TARGETS:=$(LINT_TARGETS) mypy
endif
ifeq ($(or $(findstring 3.5,$(PYTHON_VERSION)),$(findstring PyPy,$(PYTHON_IMPLEMENTATION))),)
LINT_TARGETS:=$(LINT_TARGETS) black_check
LINT_TARGETS:=$(LINT_TARGETS) mypy black_check pylint
endif


virtualenv: ./env/requirements.built

env:
virtualenv env
python -m venv env

./env/requirements.built: env requirements-dev.txt
./env/bin/pip install -r requirements-dev.txt
cp requirements-dev.txt ./env/requirements.built

.PHONY: ci
ci: test_coverage lint
ci: lint test_coverage

.PHONY: lint
lint: $(LINT_TARGETS)

flake8:
flake8 --max-line-length=$(MAX_LINE_LENGTH) setup.py examples zeroconf

pylint:
pylint zeroconf

.PHONY: black_check
black_check:
black --check setup.py examples zeroconf

mypy:
mypy examples/*.py zeroconf/*.py
# --no-warn-redundant-casts --no-warn-unused-ignores is needed since we support multiple python versions
# We should be able to drop this once python 3.6 goes away
mypy --no-warn-redundant-casts --no-warn-unused-ignores examples/*.py zeroconf

test:
nosetests -v $(TEST_ARGS)
pytest --durations=20 --timeout=60 -v tests

test_coverage:
nosetests -v --with-coverage --cover-package=zeroconf $(TEST_ARGS)
pytest --durations=20 --timeout=60 -v --cov=zeroconf --cov-branch --cov-report xml --cov-report html --cov-report term-missing tests

autopep8:
autopep8 --max-line-length=$(MAX_LINE_LENGTH) -i setup.py examples zeroconf

Loading