Skip to content

Commit cd11299

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

File tree

5 files changed

+90
-19
lines changed

5 files changed

+90
-19
lines changed

.github/workflows/main.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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", "macos-12"]
26+
- ["3.9", "py38", "macos-12"]
27+
- ["3.9", "lint", "macos-12"]
28+
- ["3.9", "py39", "macos-12"]
29+
- ["3.10", "py310", "macos-12"]
30+
- ["3.11", "py311", "macos-12"]
31+
- ["3.12", "py312", "macos-12"]
32+
- ["3.12", "py312", "macos-13"]
33+
- ["3.12", "py312", "macos-14"]
34+
runs-on: ${{ matrix.config[2] }}
35+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
36+
name: ${{ matrix.config[0] }}-${{ matrix.config[1] }}-${{ matrix.config[2] }}
37+
steps:
38+
- run: git config --global core.autocrlf false
39+
- uses: actions/checkout@v3
40+
- name: Set up Python
41+
uses: actions/setup-python@v4
42+
with:
43+
python-version: ${{ matrix.config[0] }}
44+
- name: Pip cache
45+
uses: actions/cache@v3
46+
with:
47+
path: ~/.cache/pip
48+
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
49+
restore-keys: |
50+
${{ runner.os }}-pip-${{ matrix.config[0] }}-
51+
${{ runner.os }}-pip-
52+
- name: Install dependencies
53+
run: |
54+
python -m pip install --upgrade pip
55+
pip install tox
56+
- name: Test
57+
run: tox -e ${{ 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)