Skip to content

Commit

Permalink
Build setup for both Windows and non-Windows.
Browse files Browse the repository at this point in the history
First (rough) version. Tested for builds on Windows and on WSL. Not tested with CI yet.
  • Loading branch information
lschoe committed Jul 3, 2024
1 parent 15f1b54 commit 2bc04e3
Show file tree
Hide file tree
Showing 4 changed files with 389 additions and 99 deletions.
55 changes: 55 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.PHONY: _default clean clean-libuv distclean compile debug docs test testinstalled release setup-build ci-clean


PYTHON ?= python
ROOT = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))


_default: compile


clean:
rm -fr dist/ doc/_build/ *.egg-info winloop/loop.*.pyd
rm -fr winloop/*.c winloop/*.html winloop/*.so
rm -fr winloop/handles/*.html winloop/includes/*.html
find . -name '__pycache__' | xargs rm -rf


ci-clean: clean
rm -fr build/lib.* build/temp.* build/libuv


clean-libuv:
(cd vendor/libuv; git clean -dfX)


distclean: clean clean-libuv
rm -fr build/


setup-build:
$(PYTHON) setup.py build_ext --inplace --cython-always


compile: clean setup-build


debug: clean
$(PYTHON) setup.py build_ext --inplace --debug \
--cython-always \
--cython-annotate \
--cython-directives="linetrace=True" \
--define UVLOOP_DEBUG,CYTHON_TRACE,CYTHON_TRACE_NOGIL


docs:
$(PYTHON) setup.py build_ext --inplace build_sphinx


test:
PYTHONASYNCIODEBUG=1 $(PYTHON) -m unittest discover -v tests
$(PYTHON) -m unittest discover -v tests


testinstalled:
cd "$${HOME}" && $(PYTHON) -m unittest discover -v $(ROOT)/tests
79 changes: 74 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,78 @@
[build-system]
[project]
name = "winloop"
description = "Windows version of uvloop"
authors = [{name = "Vizonex"}]
requires-python = '>=3.8.0'
readme = "README.md"
license = {text = "MIT License"}
dynamic = ["version"]
keywords = [
"asyncio",
"networking",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: AsyncIO",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: System :: Networking",
]

[project.urls]
github = "https://github.com/Vizonex/Winloop"

[project.optional-dependencies]
test = [
# pycodestyle is a dependency of flake8, but it must be frozen because
# their combination breaks too often
# (example breakage: https://gitlab.com/pycqa/flake8/issues/427)
'aiohttp>=3.8.1; python_version < "3.12"',
'aiohttp==3.9.0b0; python_version >= "3.12"',
'flake8~=5.0',
'psutil',
'pycodestyle~=2.9.0',
'pyOpenSSL~=23.0.0',
'mypy>=0.800',
'Cython(>=0.29.36,<0.30.0)',
]
docs = [
'Sphinx~=4.1.2',
'sphinxcontrib-asyncio~=0.3.0',
'sphinx_rtd_theme~=0.5.2',
]

[build-system]
requires = [
"setuptools",
"wheel",
"Cython"
"setuptools>=60",
"wheel",
"Cython(>=0.29.36,<0.30.0)",
]
build-backend = "setuptools.build_meta"

[tool.setuptools]
zip-safe = false
packages = ["winloop"]

[tool.setuptools.exclude-package-data]
"*" = ["*.c", "*.h"]

[tool.cibuildwheel]
build-frontend = "build"
test-extras = "test"
test-command = "python -m unittest discover -v {project}/tests"

build-backend = 'setuptools.build_meta'
[tool.pytest.ini_options]
addopts = "--capture=no --assert=plain --strict-markers --tb=native --import-mode=importlib"
testpaths = "tests"
filterwarnings = "default"
Loading

2 comments on commit 2bc04e3

@Vizonex
Copy link
Owner

@Vizonex Vizonex commented on 2bc04e3 Jul 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lschoe Do you think Winloop is ready for another update or is there a few things still being patched up on your end?

@lschoe
Copy link
Collaborator Author

@lschoe lschoe commented on 2bc04e3 Jul 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Vizonex. So, the current version supports python setup.py build_ext --inplace both on Windows and, what I've tested, on WSL. I haven't looked into the CI case, which will need some fixes (like for python setup.py sdist to work in general), at least to make .github\workflows\publish.yml work again. Did you check what goes wrong?

Please sign in to comment.