Commit 90472cab authored by Jason Madden's avatar Jason Madden

First part of reorg source tree for expandability.

Move 3rd party libraries to deps/ directory.

Move gevent and greentest to src/ directory. This fixes tox.

At this point the builds should all work the same. Lets check.
parent 391c4525
...@@ -5,18 +5,18 @@ build/ ...@@ -5,18 +5,18 @@ build/
*.so *.so
*.egg-info *.egg-info
gevent.*.[ch] gevent.*.[ch]
gevent/corecext.pyx src/gevent/corecext.pyx
gevent/__pycache__ src/gevent/__pycache__
gevent/libev src/gevent/libev
gevent/_corecffi.c src/gevent/_corecffi.c
gevent/_corecffi.o src/gevent/_corecffi.o
Makefile.ext Makefile.ext
MANIFEST MANIFEST
*_flymake.py *_flymake.py
greentest/.coverage\.* src/greentest/.coverage\.*
greentest/htmlcov src/greentest/htmlcov
greentest/.coverage src/greentest/.coverage
doc/changelog.rst doc/changelog.rst
doc/_build doc/_build
...@@ -33,40 +33,40 @@ doc/gevent.*.rst ...@@ -33,40 +33,40 @@ doc/gevent.*.rst
!doc/gevent.wsgi.rst !doc/gevent.wsgi.rst
# Artifacts of configuring in place # Artifacts of configuring in place
c-ares/config.log deps/c-ares/config.log
c-ares/config.status deps/c-ares/config.status
c-ares/stamp-h1 deps/c-ares/stamp-h1
c-ares/stamp-h2 deps/c-ares/stamp-h2
c-ares/ares_build.h.orig deps/c-ares/ares_build.h.orig
c-ares/ares_config.h deps/c-ares/ares_config.h
c-ares/.libs deps/c-ares/.libs
c-ares/*.o deps/c-ares/*.o
c-ares/*.lo deps/c-ares/*.lo
c-ares/*.la deps/c-ares/*.la
c-ares/.deps deps/c-ares/.deps
c-ares/acountry deps/c-ares/acountry
c-ares/adig deps/c-ares/adig
c-ares/ahost deps/c-ares/ahost
c-ares/Makefile deps/c-ares/Makefile
c-ares/libtool deps/c-ares/libtool
c-ares/libcares.pc deps/c-ares/libcares.pc
c-ares/test/.deps deps/c-ares/test/.deps
c-ares/test/Makefile deps/c-ares/test/Makefile
c-ares/test/config.log deps/c-ares/test/config.log
c-ares/test/config.status deps/c-ares/test/config.status
c-ares/test/libtool deps/c-ares/test/libtool
c-ares/test/stamp-h1 deps/c-ares/test/stamp-h1
libev/.deps deps/libev/.deps
libev/Makefile deps/libev/Makefile
libev/config.log deps/libev/config.log
libev/config.h deps/libev/config.h
libev/config.status deps/libev/config.status
libev/libtool deps/libev/libtool
libev/stamp-h1 deps/libev/stamp-h1
libev/.libs deps/libev/.libs
libev/*.lo deps/libev/*.lo
libev/*.la deps/libev/*.la
libev/*.o deps/libev/*.o
# running setup.py on PyPy # running setup.py on PyPy
config.h config.h
......
recursive-include greentest * recursive-include src/greentest *
recursive-include examples * recursive-include examples *
recursive-include gevent * recursive-include src/gevent *
recursive-include doc * recursive-include doc *
recursive-include libev * recursive-include deps *
recursive-include c-ares *
recursive-include util * recursive-include util *
include LICENSE include LICENSE
...@@ -40,14 +39,14 @@ global-exclude *.la ...@@ -40,14 +39,14 @@ global-exclude *.la
global-exclude config.log config.status global-exclude config.log config.status
prune doc/_build prune doc/_build
global-exclude *.pyc global-exclude *.pyc
recursive-exclude greentest .coverage recursive-exclude src/greentest .coverage
prune greentest/htmlcov prune src/greentest/htmlcov
recursive-exclude c-ares stamp-h? ares_build.h.orig recursive-exclude deps/c-ares stamp-h? ares_build.h.orig
prune libev/.deps prune deps/libev/.deps
recursive-exclude libev Makefile libtool stamp-h? config.h recursive-exclude deps/libev Makefile libtool stamp-h? config.h
# This is the output of _corecffi_build.py and may be particular # This is the output of _corecffi_build.py and may be particular
# to each CFFI version/platform # to each CFFI version/platform
recursive-exclude gevent _corecffi.c recursive-exclude src/gevent _corecffi.c
# See comments in Makefile; this is renamed to Makefile.ext # See comments in Makefile; this is renamed to Makefile.ext
# this exclude keeps check-manifest from complaining # this exclude keeps check-manifest from complaining
exclude Makefile exclude Makefile
...@@ -12,48 +12,48 @@ export PATH:=$(BUILD_RUNTIMES)/snakepit:$(TOOLS):$(PATH) ...@@ -12,48 +12,48 @@ export PATH:=$(BUILD_RUNTIMES)/snakepit:$(TOOLS):$(PATH)
export LC_ALL=C.UTF-8 export LC_ALL=C.UTF-8
all: gevent/gevent.corecext.c gevent/gevent.ares.c gevent/gevent._semaphore.c all: src/gevent/gevent.corecext.c src/gevent/gevent.ares.c src/gevent/gevent._semaphore.c
gevent/gevent.corecext.c: gevent/corecext.ppyx gevent/libev.pxd util/cythonpp.py src/gevent/gevent.corecext.c: src/gevent/corecext.ppyx src/gevent/libev.pxd util/cythonpp.py
$(PYTHON) util/cythonpp.py -o gevent.corecext.c gevent/corecext.ppyx $(PYTHON) util/cythonpp.py -o gevent.corecext.c src/gevent/corecext.ppyx
echo '#include "callbacks.c"' >> gevent.corecext.c echo '#include "callbacks.c"' >> gevent.corecext.c
mv gevent.corecext.* gevent/ mv gevent.corecext.* src/gevent/
gevent/gevent.ares.c: gevent/ares.pyx gevent/*.pxd src/gevent/gevent.ares.c: src/gevent/ares.pyx src/gevent/*.pxd
$(CYTHON) -o gevent.ares.c gevent/ares.pyx $(CYTHON) -o gevent.ares.c gevent/ares.pyx
mv gevent.ares.* gevent/ mv gevent.ares.* src/gevent/
gevent/gevent._semaphore.c: gevent/_semaphore.py gevent/_semaphore.pxd src/gevent/gevent._semaphore.c: src/gevent/_semaphore.py src/gevent/_semaphore.pxd
# On PyPy, if we wanted to use Cython to compile _semaphore.py, we'd # On PyPy, if we wanted to use Cython to compile _semaphore.py, we'd
# need to have _semaphore named as a .pyx file so it doesn't get # need to have _semaphore named as a .pyx file so it doesn't get
# loaded in preference to the .so. (We want to keep the definitions # loaded in preference to the .so. (We want to keep the definitions
# separate in a .pxd file for ease of reading, and that only works # separate in a .pxd file for ease of reading, and that only works
# with .py files, so we'd have to copy them back and forth.) # with .py files, so we'd have to copy them back and forth.)
# cp gevent/_semaphore.pyx gevent/_semaphore.py # cp src/gevent/_semaphore.pyx src/gevent/_semaphore.py
$(CYTHON) -o gevent._semaphore.c gevent/_semaphore.py $(CYTHON) -o gevent._semaphore.c src/gevent/_semaphore.py
mv gevent._semaphore.* gevent/ mv gevent._semaphore.* src/gevent/
# rm gevent/_semaphore.py # rm src/gevent/_semaphore.py
clean: clean:
rm -f corecext.pyx gevent/corecext.pyx rm -f corecext.pyx src/gevent/corecext.pyx
rm -f gevent.corecext.c gevent.corecext.h gevent/gevent.corecext.c gevent/gevent.corecext.h rm -f gevent.corecext.c gevent.corecext.h src/gevent/gevent.corecext.c src/gevent/gevent.corecext.h
rm -f gevent.ares.c gevent.ares.h gevent/gevent.ares.c gevent/gevent.ares.h rm -f gevent.ares.c gevent.ares.h src/gevent/gevent.ares.c src/gevent/gevent.ares.h
rm -f gevent._semaphore.c gevent._semaphore.h gevent/gevent._semaphore.c gevent/gevent._semaphore.h rm -f gevent._semaphore.c gevent._semaphore.h src/gevent/gevent._semaphore.c src/gevent/gevent._semaphore.h
rm -f gevent/*.so rm -f src/gevent/*.so
rm -rf gevent/__pycache__ rm -rf src/gevent/__pycache__
rm -rf gevent/*.pyc rm -rf src/gevent/*.pyc
doc: doc:
cd doc && PYTHONPATH=.. make html cd doc && PYTHONPATH=.. make html
whitespace: whitespace:
! find . -not -path "*.pem" -not -path "./.eggs/*" -not -path "./greentest/htmlcov/*" -not -path "./greentest/.coverage.*" -not -path "./.tox/*" -not -path "*/__pycache__/*" -not -path "*.so" -not -path "*.pyc" -not -path "./.git/*" -not -path "./build/*" -not -path "./libev/*" -not -path "./gevent/libev/*" -not -path "./gevent.egg-info/*" -not -path "./dist/*" -not -path "./.DS_Store" -not -path "./c-ares/*" -not -path "./gevent/gevent.*.[ch]" -not -path "./gevent/corecext.pyx" -not -path "./doc/_build/*" -not -path "./doc/mytheme/static/*" -type f | xargs egrep -l " $$" ! find . -not -path "*.pem" -not -path "./.eggs/*" -not -path "./src/greentest/htmlcov/*" -not -path "./src/greentest/.coverage.*" -not -path "./.tox/*" -not -path "*/__pycache__/*" -not -path "*.so" -not -path "*.pyc" -not -path "./.git/*" -not -path "./build/*" -not -path "./src/gevent/libev/*" -not -path "./gevent.egg-info/*" -not -path "./dist/*" -not -path "./.DS_Store" -not -path "./deps/*" -not -path "./src/gevent/gevent.*.[ch]" -not -path "./src/gevent/corecext.pyx" -not -path "./doc/_build/*" -not -path "./doc/mytheme/static/*" -type f | xargs egrep -l " $$"
prospector: prospector:
which prospector which prospector
which pylint which pylint
# debugging # debugging
# pylint --rcfile=.pylintrc --init-hook="import sys, code; sys.excepthook = lambda exc, exc_type, tb: print(tb.tb_next.tb_next.tb_next.tb_next.tb_next.tb_next.tb_next.tb_next.tb_next.tb_next.tb_frame.f_locals['self'])" gevent greentest/* || true # pylint --rcfile=.pylintrc --init-hook="import sys, code; sys.excepthook = lambda exc, exc_type, tb: print(tb.tb_next.tb_next.tb_next.tb_next.tb_next.tb_next.tb_next.tb_next.tb_next.tb_next.tb_frame.f_locals['self'])" gevent src/greentest/* || true
${PYTHON} scripts/gprospector.py -X ${PYTHON} scripts/gprospector.py -X
lint: whitespace prospector lint: whitespace prospector
...@@ -66,18 +66,18 @@ test_prelim: ...@@ -66,18 +66,18 @@ test_prelim:
make bench make bench
toxtest: test_prelim toxtest: test_prelim
cd greentest && GEVENT_RESOLVER=thread ${PYTHON} testrunner.py --config ../known_failures.py cd src/greentest && GEVENT_RESOLVER=thread ${PYTHON} testrunner.py --config known_failures.py
fulltoxtest: test_prelim fulltoxtest: test_prelim
cd greentest && GEVENT_RESOLVER=thread ${PYTHON} testrunner.py --config ../known_failures.py cd src/greentest && GEVENT_RESOLVER=thread ${PYTHON} testrunner.py --config known_failures.py
cd greentest && GEVENT_RESOLVER=ares GEVENTARES_SERVERS=8.8.8.8 ${PYTHON} testrunner.py --config ../known_failures.py --ignore tests_that_dont_use_resolver.txt cd src/greentest && GEVENT_RESOLVER=ares GEVENTARES_SERVERS=8.8.8.8 ${PYTHON} testrunner.py --config known_failures.py --ignore tests_that_dont_use_resolver.txt
cd greentest && GEVENT_FILE=thread ${PYTHON} testrunner.py --config ../known_failures.py `grep -l subprocess test_*.py` cd src/greentest && GEVENT_FILE=thread ${PYTHON} testrunner.py --config known_failures.py `grep -l subprocess test_*.py`
leaktest: leaktest:
GEVENTSETUP_EV_VERIFY=3 GEVENTTEST_LEAKCHECK=1 make fulltoxtest GEVENTSETUP_EV_VERIFY=3 GEVENTTEST_LEAKCHECK=1 make fulltoxtest
bench: bench:
${PYTHON} greentest/bench_sendall.py ${PYTHON} src/greentest/bench_sendall.py
travis_test_linters: travis_test_linters:
...@@ -85,9 +85,9 @@ travis_test_linters: ...@@ -85,9 +85,9 @@ travis_test_linters:
GEVENTTEST_COVERAGE=1 make leaktest GEVENTTEST_COVERAGE=1 make leaktest
# because we set parallel=true, each run produces new and different coverage files; they all need # because we set parallel=true, each run produces new and different coverage files; they all need
# to be combined # to be combined
coverage combine . greentest/ coverage combine . src/greentest/
coveralls --rcfile=greentest/.coveragerc coveralls --rcfile=src/greentest/.coveragerc
.PHONY: clean all doc prospector whitespace lint travistest travis .PHONY: clean all doc prospector whitespace lint travistest travis
...@@ -171,6 +171,6 @@ test-py27-cffi: $(PY27) ...@@ -171,6 +171,6 @@ test-py27-cffi: $(PY27)
GEVENT_CORE_CFFI_ONLY=1 PYTHON=python2.7 PATH=$(BUILD_RUNTIMES)/versions/python2.7/bin:$(PATH) make develop toxtest GEVENT_CORE_CFFI_ONLY=1 PYTHON=python2.7 PATH=$(BUILD_RUNTIMES)/versions/python2.7/bin:$(PATH) make develop toxtest
test-py27-noembed: $(PY27) test-py27-noembed: $(PY27)
cd libev && ./configure --disable-dependency-tracking && make cd deps/libev && ./configure --disable-dependency-tracking && make
cd c-ares && ./configure --disable-dependency-tracking && make cd deps/c-ares && ./configure --disable-dependency-tracking && make
CPPFLAGS="-Ilibev -Ic-ares" LDFLAGS="-Llibev/.libs -Lc-ares/.libs" LD_LIBRARY_PATH="$(PWD)/libev/.libs:$(PWD)/c-ares/.libs" EMBED=0 GEVENT_CORE_CEXT_ONLY=1 PYTHON=python2.7 PATH=$(BUILD_RUNTIMES)/versions/python2.7/bin:$(PATH) make develop toxtest CPPFLAGS="-Ideps/libev -Ideps/c-ares" LDFLAGS="-Ldeps/libev/.libs -Ldeps/c-ares/.libs" LD_LIBRARY_PATH="$(PWD)/deps/libev/.libs:$(PWD)/deps/c-ares/.libs" EMBED=0 GEVENT_CORE_CEXT_ONLY=1 PYTHON=python2.7 PATH=$(BUILD_RUNTIMES)/versions/python2.7/bin:$(PATH) make develop toxtest
...@@ -77,8 +77,8 @@ There are a few different ways to run the tests. To simply run the ...@@ -77,8 +77,8 @@ There are a few different ways to run the tests. To simply run the
tests on one version of Python during development, try this:: tests on one version of Python during development, try this::
python setup.py develop python setup.py develop
cd greentest cd src/greentest
PYTHONPATH=.. python testrunner.py --config ../known_failures.py PYTHONPATH=.. python testrunner.py --config known_failures.py
Before submitting a pull request, it's a good idea to run the tests Before submitting a pull request, it's a good idea to run the tests
across all supported versions of Python, and to check the code quality across all supported versions of Python, and to check the code quality
...@@ -93,8 +93,8 @@ The testrunner accepts a ``--coverage`` argument to enable code ...@@ -93,8 +93,8 @@ The testrunner accepts a ``--coverage`` argument to enable code
coverage metrics through the `coverage.py`_ package. That would go coverage metrics through the `coverage.py`_ package. That would go
something like this:: something like this::
cd greentest cd src/greentest
PYTHONPATH=.. python testrunner.py --config ../known_failures.py --coverage PYTHONPATH=.. python testrunner.py --config known_failures.py --coverage
coverage combine coverage combine
coverage html -i coverage html -i
<open htmlcov/index.html> <open htmlcov/index.html>
......
...@@ -145,7 +145,7 @@ build_script: ...@@ -145,7 +145,7 @@ build_script:
test_script: test_script:
# Run the project tests # Run the project tests
- "cd greentest && %PYEXE% testrunner.py --config ../known_failures.py && cd .." - "cd src/greentest && %PYEXE% testrunner.py --config known_failures.py && cd ../.."
after_test: after_test:
# We already built the wheel during build_script, because it's # We already built the wheel during build_script, because it's
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment