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

Combine event loop cleanup with other style/modernization cleanup #4

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
aa31ec4
Remove global `util.main_event_loop`
gnzsnz Aug 15, 2024
56795b3
update github actions, replace flake by ruff
gnzsnz Aug 15, 2024
9c941f1
fix github actions
gnzsnz Aug 15, 2024
0496e6d
upgrade checkout and set-up python actions
gnzsnz Aug 15, 2024
b7b51e6
fix
gnzsnz Aug 15, 2024
b49b2c8
Move to Python 3.10+ and add dev to optional group
mattsta Aug 18, 2024
9dd6f13
Cleanup github CI configuration
mattsta Aug 18, 2024
2ae8bc8
Cleanup coding style for readability
mattsta Aug 18, 2024
7af5787
Fix more event loop fetching
mattsta Aug 18, 2024
775c3ec
Cleanup ruff style complaint
mattsta Aug 18, 2024
a29c3b7
Fix CI error with docs building
mattsta Aug 18, 2024
b80e08c
Fix naming conflict in docs config
mattsta Aug 18, 2024
0dd4ad4
New test for emit_threadsafe
gnzsnz Aug 20, 2024
e8c314d
organize import on event.py, place import before code
gnzsnz Aug 20, 2024
e6faadc
undo event.py imports re-organization as it causes circular dependencies
gnzsnz Aug 20, 2024
eaf4c3f
Modernize Slots management into dataclasses
mattsta Aug 24, 2024
210f48d
add tests for Event.Slot and Event.Slots
gnzsnz Aug 27, 2024
05ee827
use Event._split to build slot
gnzsnz Aug 27, 2024
ccf5325
remove unused import
gnzsnz Aug 27, 2024
68ea189
apply Event._split
gnzsnz Aug 28, 2024
9ecec8d
Implement github actions
gnzsnz Aug 28, 2024
8681633
use eventkit.util.get_event_loop() in tests
gnzsnz Aug 28, 2024
d63441e
Changes
gnzsnz Aug 29, 2024
18e3a4f
remove type hint to avoid mypy error
gnzsnz Aug 29, 2024
fde4203
avoid duplicate execution
gnzsnz Aug 29, 2024
0851e26
add mypy hook to pre-commit
gnzsnz Aug 29, 2024
2bca019
fix error on exception handling during emit/slots.__call__
gnzsnz Sep 1, 2024
5628f9f
pre-
gnzsnz Sep 6, 2024
09cf836
pypy support for weakref tests
gnzsnz Sep 6, 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: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions # See documentation for possible values
directory: .github/ # Location of package manifests
schedule:
interval: weekly
42 changes: 42 additions & 0 deletions .github/workflows/build-n-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build 🛠️ and test 🧪 eventkit

on: [push, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [pypy3.10, "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
# Print the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install -U pip poetry
poetry install --with dev

- name: Ruff static code analysis
run: |
poetry run ruff check eventkit/
poetry run ruff format eventkit/

- name: MyPy static code analysis
run: |
poetry run mypy .

- name: Test with pytest
run: |
poetry run pytest -vs

- name: Build a binary wheel and a source tarball
run: |
poetry build -n
91 changes: 91 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Publish Python 🐍 distribution 📦 to PyPI

on:
workflow_dispatch:
push:
tags:
- v*

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
- name: "Install pypa/build"
run: |
python -m pip install -U pip poetry
- name: "Build a binary wheel and a source tarball"
run: |
poetry build -n
- name: "Store the distribution packages"
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/eventkit

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: "Download all the dists"
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: "Publish distribution 📦 to PyPI"
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: >-
Sign the 📦 with Sigstore and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: "Download all the dists"
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: "Sign the dists with Sigstore"
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz ./dist/*.whl
- name: "Create GitHub Release"
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create '${{ github.ref_name }}' \
--repo '${{ github.repository }}' --notes ""
- name: "Upload artifact signatures to GitHub Release"
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload '${{ github.ref_name }}' dist/** \
--repo '${{ github.repository }}'
35 changes: 0 additions & 35 deletions .github/workflows/test.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ docs/html/.doctrees
docs/doctrees
eventkit.egg-info
dist/
html/
poetry.lock
.python-version
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ repos:
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
- id: mypy
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

7 changes: 4 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from importlib.metadata import version as packageversion

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
Expand All @@ -12,12 +14,11 @@
copyright = "2021, Ewald de Wit"
author = "Ewald de Wit"

__version__ = None
exec(open("../eventkit/version.py").read())
__version__ = packageversion("eventkit")
version = ".".join(__version__.split(".")[:2])
release = __version__

language = None
language = "en"
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
pygments_style = "sphinx"
todo_include_todos = False
Expand Down
36 changes: 0 additions & 36 deletions docs/make.bat

This file was deleted.

3 changes: 0 additions & 3 deletions docs/requirements.txt

This file was deleted.

Loading