Skip to content

Commit 3854205

Browse files
committed
Add GitHub workflow to build distribution artifacts and run automated tests
1 parent 7bd5a33 commit 3854205

File tree

5 files changed

+88
-19
lines changed

5 files changed

+88
-19
lines changed

.github/workflows/main.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
on:
2+
push:
3+
pull_request:
4+
# Allow to run this workflow manually from the Actions tab
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
runs-on: macos-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- run: python -m pip install setuptools wheel
13+
- run: python setup.py sdist
14+
- run: python setup.py bdist_wheel
15+
- uses: actions/upload-artifact@v4
16+
with:
17+
name: MacFSEvents
18+
path: ./dist/
19+
test:
20+
strategy:
21+
# We want to see all failures:
22+
fail-fast: false
23+
matrix:
24+
config:
25+
- ["3.8", "py38 lint", "macos-12"]
26+
- ["3.9", "py39", "macos-12"]
27+
- ["3.10", "py310", "macos-12"]
28+
- ["3.11", "py311", "macos-12"]
29+
- ["3.12", "py312", "macos-12"]
30+
- ["3.12", "py312", "macos-13"]
31+
- ["3.12", "py312", "macos-14"]
32+
runs-on: ${{ matrix.config[2] }}
33+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
34+
name: ${{ matrix.config[0] }}-${{ matrix.config[1] }}
35+
steps:
36+
- run: git config --global core.autocrlf false
37+
- uses: actions/checkout@v3
38+
- name: Set up Python
39+
uses: actions/setup-python@v4
40+
with:
41+
python-version: ${{ matrix.config[0] }}
42+
- name: Pip cache
43+
uses: actions/cache@v3
44+
with:
45+
path: ~/.cache/pip
46+
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
47+
restore-keys: |
48+
${{ runner.os }}-pip-${{ matrix.config[0] }}-
49+
${{ runner.os }}-pip-
50+
- name: Install dependencies
51+
run: |
52+
python -m pip install --upgrade pip
53+
pip install tox
54+
- name: Test
55+
run: tox -- ${{ matrix.config[1] }}

.travis.yml

-18
This file was deleted.

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include *.py
2+
include tox.ini

fsevents.py

+30
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import unicodedata
55

66
from _fsevents import (
7+
FS_CFLAGFILEEVENTS,
78
FS_CFLAGNONE,
89
FS_EVENTIDSINCENOW,
910
FS_FLAGEVENTIDSWRAPPED,
@@ -320,3 +321,32 @@ def snapshot(self, path):
320321
entry[obj] = os.lstat(os.path.join(root, obj))
321322
except OSError:
322323
continue
324+
325+
326+
__all__ = (
327+
FS_CFLAGFILEEVENTS,
328+
FS_CFLAGNONE,
329+
FS_EVENTIDSINCENOW,
330+
FS_FLAGEVENTIDSWRAPPED,
331+
FS_FLAGHISTORYDONE,
332+
FS_FLAGKERNELDROPPED,
333+
FS_FLAGMOUNT,
334+
FS_FLAGMUSTSCANSUBDIRS,
335+
FS_FLAGROOTCHANGED,
336+
FS_FLAGUNMOUNT,
337+
FS_FLAGUSERDROPPED,
338+
FS_ITEMCHANGEOWNER,
339+
FS_ITEMCREATED,
340+
FS_ITEMFINDERINFOMOD,
341+
FS_ITEMINODEMETAMOD,
342+
FS_ITEMISDIR,
343+
FS_ITEMISFILE,
344+
FS_ITEMISSYMLINK,
345+
FS_ITEMMODIFIED,
346+
FS_ITEMREMOVED,
347+
FS_ITEMRENAMED,
348+
FS_ITEMXATTRMOD,
349+
FileEvent,
350+
Stream,
351+
Observer,
352+
)

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ basepython = python3
2727
skip_install = true
2828
commands =
2929
isort --check-only --diff .
30-
flake8 *.py
30+
flake8 -v tests.py fsevents.py
3131
check-manifest
3232
check-python-versions
3333
deps =

0 commit comments

Comments
 (0)