Skip to content

Commit 576df11

Browse files
authored
Merge pull request #6 from karellen/hookup_travis_and_pyb
PyB and Travis
2 parents e6a7a3c + 47df532 commit 576df11

40 files changed

+823
-156
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ docs/_build/
6868

6969
# PyBuilder
7070
target/
71+
.pybuilder/
7172

7273
# Jupyter Notebook
7374
.ipynb_checkpoints

.idea/.gitignore

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/geventmp.iml

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.travis.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
language: c
2+
dist: bionic
3+
branches:
4+
only:
5+
- master
6+
os:
7+
- linux
8+
- osx
9+
osx_image: xcode11.3
10+
env:
11+
jobs:
12+
- PYTHON_VERSION="3.8.2" GEVENT_VERSION="~=1.5.0"
13+
- PYTHON_VERSION="3.8.2" GEVENT_VERSION=">=1.3.0"
14+
- PYTHON_VERSION="2.7.18" GEVENT_VERSION="~=1.3.0"
15+
- PYTHON_VERSION="2.7.18" GEVENT_VERSION="~=1.4.0"
16+
- PYTHON_VERSION="2.7.18" GEVENT_VERSION="~=1.5.0"
17+
- PYTHON_VERSION="2.7.18" GEVENT_VERSION=">=1.3.0"
18+
- PYTHON_VERSION="3.7.7" GEVENT_VERSION="~=1.3.0"
19+
- PYTHON_VERSION="3.7.7" GEVENT_VERSION="~=1.4.0"
20+
- PYTHON_VERSION="3.7.7" GEVENT_VERSION="~=1.5.0"
21+
- PYTHON_VERSION="3.7.7" GEVENT_VERSION=">=1.3.0"
22+
- PYTHON_VERSION="3.6.10" GEVENT_VERSION="~=1.3.0"
23+
- PYTHON_VERSION="3.6.10" GEVENT_VERSION="~=1.4.0"
24+
- PYTHON_VERSION="3.6.10" GEVENT_VERSION="~=1.5.0"
25+
- PYTHON_VERSION="3.6.10" GEVENT_VERSION=">=1.3.0"
26+
- PYTHON_VERSION="3.5.9" GEVENT_VERSION="~=1.3.0"
27+
- PYTHON_VERSION="3.5.9" GEVENT_VERSION="~=1.4.0"
28+
- PYTHON_VERSION="3.5.9" GEVENT_VERSION="~=1.5.0"
29+
- PYTHON_VERSION="3.5.9" GEVENT_VERSION=">=1.3.0"
30+
- PYTHON_VERSION="pypy3.6-7.3.0"
31+
- PYTHON_VERSION="pypy2.7-7.3.0"
32+
- PYTHON_VERSION="pypy3.5-7.0.0"
33+
global:
34+
- DEPLOY_BRANCHES: "'master'"
35+
- DEPLOY_PYTHONS: "'2.7.18 3.8.2'"
36+
- DEPLOY_OSES: "'linux'"
37+
- DEPLOY_GEVENTS: "'>=1.3.0'"
38+
- PYB_ARGS: "'-E ci -v -X analyze install'"
39+
- TWINE_USERNAME: "__token__"
40+
- secure: "B8bZJPaWYeSLuMOhaKO+H3KBw/bjON7OOHBYhJFPcZ2HBTd6vJyD915UANUcJgnFUIHreWe1KL7AXXvd6JdAvFZvyxNOsIMxBpvBpv/HBnWVnDP3GzAaBU5ZqfhBDY4igyQBw3W3JoKDcnxTtysf3Qb6Chi7luU1oA4JRzqH7HzVHcTXVYYXz7XV4X64B0U6W+mEy9FMfvMnON3DwPRIy66O+BgiutKjFR8dhBKw79XaP0ff+YpUREvvG+IoAHH+N1ugT2sUQpqCfJx6ORxscvvPXTTt+DmqM1YmKU9i18Z9gS2clC66UZqF4Yyo5GDVtCFqZwnIyhhQPflxlb0aXIuEWeHok8Xc2Z0GSLMXEuq5MyjCz+TEC+xrA9X92RLQrK0412HM66WZ6nM++AnAqbA7aDcLsZJ6Rk1gz5tAR3nKAW9c4mrlnMG1ILMGTsxEz9NUj2omIyF5M6k8hwLkOjz42rOC/h7MbRqsupmU4SyJ949vGHnmm0LE16wDFvjyz6u/ntx3A2WO/EVNiStJFRz6pPFkX80muRE6SlrNjMxJDZxzd2FTu3Dr3m9o1WB66gy5DCAZP1H0FpDl52GSj5BNPR3XgpRzWyArojCRtYQU0V/k+98gJwRCFSRSrj6HMHooc/4INXGks4UStoAljj75nq6GeKWk+iZrozkp+Ws="
41+
jobs:
42+
allow_failures:
43+
- if: env(PYTHON_VERSION) =~ /^pypy.+$/
44+
45+
cache:
46+
directories:
47+
- $HOME/.pyenv
48+
49+
install: travis_wait 30 python travis/travis_shim.py install
50+
script: travis_wait 60 python travis/travis_shim.py build

README.rst

+9-8
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,18 @@ Supported Platforms
8383
.. note::
8484
All claims of support may not be real at all. You're welcome to experiment. See warnings on top.
8585

86-
* Linux, possibly Darwin.
87-
* CPython 2.7, 3.5, 3.6, 3.7... maybe.
86+
* Linux and Darwin.
87+
* CPython 2.7, 3.5, 3.6, 3.7, 3.8.
88+
89+
Known Issues
90+
============
91+
92+
* Multiprocessing `forkserver` works with gevent, but the spawned child isn't green.
8893

8994
TODO
9095
====
91-
1. Implement CI/CD once we figure out how `Gevent Issue #1448 <https://github.com/gevent/gevent/issues/1448>`_ is going
92-
to go.
93-
2. Test on CPython 2.7, 3.5, 3.6, 3.7, 3.8, PyPys etc.
94-
3. Monkey patch Windows to the extent possible.
95-
4. Test and fix Darwin if required.
96-
5. Lots of applications use `Billiard <https://github.com/celery/billiard>`_ for multiprocessing instead of stock Python
96+
1. Monkey patch Windows to the extent possible.
97+
2. Lots of applications use `Billiard <https://github.com/celery/billiard>`_ for multiprocessing instead of stock Python
9798
package. Consider monkey patching Billiard if detected.
9899

99100
Contact Us

build.py

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# -*- coding: utf-8 -*-
2+
from pybuilder.core import (use_plugin, init, Author, before, Dependency)
3+
4+
use_plugin("python.core")
5+
use_plugin("python.integrationtest")
6+
use_plugin("python.flake8")
7+
use_plugin("python.coverage")
8+
use_plugin("python.distutils")
9+
use_plugin("python.pycharm")
10+
use_plugin("python.coveralls")
11+
use_plugin("copy_resources")
12+
13+
name = "geventmp"
14+
version = "0.0.1.dev"
15+
16+
summary = "Multiprocessing Gevent Extension"
17+
authors = [Author("Karellen, Inc.", "supervisor@karellen.co")]
18+
maintainers = [Author("Arcadiy Ivanov", "arcadiy@ivanov.biz")]
19+
url = "https://github.com/karellen/geventmp"
20+
urls = {
21+
"Bug Tracker": "https://github.com/karellen/geventmp/issues",
22+
"Source Code": "https://github.com/karellen/geventmp/",
23+
"Documentation": "https://github.com/karellen/geventmp/"
24+
}
25+
license = "Apache License, Version 2.0"
26+
27+
requires_python = ">=2.7,!=3.0,!=3.1,!=3.2,!=3.3,!=3.4"
28+
29+
default_task = ["analyze", "publish"]
30+
31+
32+
@init
33+
def set_properties(project):
34+
project.set_property_if_unset("gevent_version", ">=1.3.0")
35+
36+
project.depends_on("gevent", project.get_property("gevent_version"))
37+
38+
project.set_property("coverage_break_build", False)
39+
40+
project.set_property("integrationtest_inherit_environment", True)
41+
42+
project.set_property("flake8_break_build", True)
43+
project.set_property("flake8_extend_ignore", "E303,E402")
44+
project.set_property("flake8_include_test_sources", True)
45+
project.set_property("flake8_include_scripts", True)
46+
project.set_property("flake8_max_line_length", 130)
47+
48+
project.set_property("copy_resources_target", "$dir_dist/geventmp")
49+
project.get_property("copy_resources_glob").append("LICENSE")
50+
project.include_file("geventmp", "LICENSE")
51+
52+
project.set_property("distutils_readme_description", True)
53+
project.set_property("distutils_description_overwrite", True)
54+
project.set_property("distutils_upload_skip_existing", True)
55+
project.set_property("distutils_setup_keywords", ["gevent", "multiprocessing", "mp", "monkey"])
56+
project.set_property("distutils_readme_file", "README.rst")
57+
project.set_property("distutils_readme_file_type", "text/x-rst")
58+
project.set_property("distutils_readme_file_encoding", "UTF-8")
59+
60+
project.set_property("distutils_entry_points", {
61+
"gevent.plugins.monkey.will_patch_all": ["geventmp = geventmp.monkey:_patch_mp"]
62+
})
63+
64+
project.set_property("distutils_classifiers", [
65+
"License :: OSI Approved :: Apache Software License",
66+
"Programming Language :: Python :: 2.7",
67+
"Programming Language :: Python :: 3.5",
68+
"Programming Language :: Python :: 3.6",
69+
"Programming Language :: Python :: 3.7",
70+
"Programming Language :: Python :: 3.8",
71+
"Programming Language :: Python :: Implementation :: CPython",
72+
"Operating System :: MacOS :: MacOS X",
73+
"Operating System :: POSIX",
74+
"Topic :: Internet",
75+
"Topic :: Software Development :: Libraries :: Python Modules",
76+
"Intended Audience :: Developers",
77+
"Development Status :: 3 - Alpha"
78+
])
79+
80+
81+
@before("run_integration_tests", only_once=True)
82+
def install_for_tests(project, logger, reactor):
83+
reactor.python_env_registry["test"].install_dependencies([Dependency(project.expand_path("$dir_dist"))])

pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["pybuilder>=0.12.0"]
3+
build-backend = "pybuilder.pep517"

setup.cfg

-48
This file was deleted.

setup.py

+87-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,89 @@
11
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# This file is part of PyBuilder
5+
#
6+
# Copyright 2011-2020 PyBuilder Team
7+
#
8+
# Licensed under the Apache License, Version 2.0 (the "License");
9+
# you may not use this file except in compliance with the License.
10+
# You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
219

3-
from setuptools import find_packages
4-
from setuptools import setup
5-
6-
setup(
7-
test_suite="greentest.testrunner",
8-
entry_points={
9-
'gevent.plugins.monkey.will_patch_all': [
10-
"geventmp = geventmp.monkey:_patch_mp",
11-
],
12-
},
13-
)
20+
#
21+
# This script allows to support installation via:
22+
# pip install git+git://<project>@<branch>
23+
#
24+
# This script is designed to be used in combination with `pip install` ONLY
25+
#
26+
# DO NOT RUN MANUALLY
27+
#
28+
29+
import os
30+
import subprocess
31+
import sys
32+
import glob
33+
import shutil
34+
35+
from sys import version_info
36+
py3 = version_info[0] == 3
37+
py2 = not py3
38+
if py2:
39+
FileNotFoundError = OSError
40+
41+
42+
def install_pyb():
43+
try:
44+
subprocess.check_call([sys.executable, "-m", "pip", "install", "pybuilder"])
45+
except subprocess.CalledProcessError as e:
46+
sys.exit(e.returncode)
47+
48+
49+
script_dir = os.path.dirname(os.path.realpath(__file__))
50+
exit_code = 0
51+
52+
try:
53+
subprocess.check_call(["pyb", "--version"])
54+
except FileNotFoundError as e:
55+
if py3 or py2 and e.errno == 2:
56+
install_pyb()
57+
else:
58+
raise
59+
except subprocess.CalledProcessError as e:
60+
if e.returncode == 127:
61+
install_pyb()
62+
else:
63+
sys.exit(e.returncode)
64+
65+
try:
66+
from pybuilder.cli import main
67+
# verbose, debug, skip all optional...
68+
if main("-v", "-X", "-o", "--reset-plugins", "clean", "package"):
69+
raise RuntimeError("PyBuilder build failed")
70+
71+
from pybuilder.reactor import Reactor
72+
reactor = Reactor.current_instance()
73+
project = reactor.project
74+
dist_dir = project.expand_path("$dir_dist")
75+
76+
for src_file in glob.glob(os.path.join(dist_dir, "*")):
77+
file_name = os.path.basename(src_file)
78+
target_file_name = os.path.join(script_dir, file_name)
79+
if os.path.exists(target_file_name):
80+
if os.path.isdir(target_file_name):
81+
shutil.rmtree(target_file_name)
82+
else:
83+
os.remove(target_file_name)
84+
shutil.move(src_file, script_dir)
85+
setup_args = sys.argv[1:]
86+
subprocess.check_call([sys.executable, "setup.py"] + setup_args, cwd=script_dir)
87+
except subprocess.CalledProcessError as e:
88+
exit_code = e.returncode
89+
sys.exit(exit_code)

src/geventmp/__init__.py

Whitespace-only changes.

src/geventmp/_mp/2_7/__init__.py

Whitespace-only changes.

src/geventmp/_mp/3/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)