Skip to content

Commit

Permalink
include certs in sdist, made setup.py test command work. Fixes irmen#216
Browse files Browse the repository at this point in the history
  • Loading branch information
irmen committed Mar 8, 2019
1 parent 6c756d5 commit b68e84e
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 33 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ recursive-include tests *
recursive-include examples *
recursive-include docs *
recursive-include contrib *
recursive-include certs *
global-exclude */.svn/*
global-exclude */.idea/*
global-exclude *.class
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ all:
lint:
pycodestyle

test:
$(PYTHON) setup.py test

sdist:
$(PYTHON) setup.py sdist
@echo "Look in the dist/ directory"
Expand All @@ -25,9 +28,6 @@ upload:
install:
$(PYTHON) setup.py install

test:
PYTHONPATH=./src $(PYTHON) tests/run_testsuite.py

clean:
@echo "Removing tox dirs, logfiles, Pyro URI dumps, .pyo/.pyc files..."
rm -rf .tox
Expand Down
1 change: 1 addition & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Change Log
- the behavior of the NATPORT config item has been corrected to be in line with the API behavior of the Daemon:
if you leave this at 0 (the default), it will now correctly replicate the internal port number as NAT port
(instead of crashing with a configuration error)
- certs are now included in sdist archive so the ssl unit tests also run as intended


**Pyro 4.75**
Expand Down
65 changes: 36 additions & 29 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import print_function
import sys
import re
import unittest

try:
# try setuptools first, to get access to build_sphinx and test commands
Expand All @@ -12,19 +13,26 @@

using_setuptools = False


def pyro_test_suite():
testloader = unittest.TestLoader()
testsuite = testloader.discover("tests/PyroTests", pattern="test*.py")
return testsuite


if __name__ == '__main__':
with open("src/Pyro4/constants.py") as constants_file:
# extract the VERSION definition from the Pyro4.constants module without importing it
version_line = next(line for line in constants_file if line.startswith("VERSION"))
pyro4_version = re.match("VERSION ?= ?['\"](.+)['\"]", version_line).group(1)
print('Pyro version = %s' % pyro4_version)

setupargs = {
"name": "Pyro4",
"version": pyro4_version,
"license": "MIT",
"description": "distributed object middleware for Python (RPC)",
"long_description": """Pyro means PYthon Remote Objects.
setup(
name="Pyro4",
version=pyro4_version,
license="MIT",
description="distributed object middleware for Python (RPC)",
long_description="""Pyro means PYthon Remote Objects.
It is a library that enables you to build applications in which
objects can talk to eachother over the network, with minimal programming effort.
You can just use normal Python method calls, with almost every possible parameter
Expand All @@ -38,20 +46,21 @@
The documentation can be found here: http://pyro4.readthedocs.io
""",
"author": "Irmen de Jong",
"author_email": "[email protected]",
"keywords": ["distributed objects", "RPC", "remote method call", "IPC"],
"url": "http://pyro4.readthedocs.io",
"package_dir": {'': 'src'},
"packages": ['Pyro4', 'Pyro4.socketserver', 'Pyro4.test', 'Pyro4.utils'],
"scripts": [],
"platforms": "any",
"install_requires": ["serpent>=1.27"],
"extras_require": {
author="Irmen de Jong",
author_email="[email protected]",
keywords=["distributed objects", "RPC", "remote method call", "IPC"],
url="http://pyro4.readthedocs.io",
package_dir={'': 'src'},
packages=['Pyro4', 'Pyro4.socketserver', 'Pyro4.test', 'Pyro4.utils'],
scripts=[],
platforms="any",
test_suite="setup.pyro_test_suite",
install_requires=["serpent>=1.27"],
extras_require={
":python_version<'3.4'": ["selectors34"]
},
"requires": ["serpent"],
"classifiers": [
requires=["serpent"],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
Expand All @@ -69,20 +78,18 @@
"Topic :: System :: Distributed Computing",
"Topic :: System :: Networking"
],
"entry_points": {
entry_points={
'console_scripts': [
'pyro4-ns = Pyro4.naming:main',
'pyro4-nsc = Pyro4.nsc:main',
'pyro4-test-echoserver = Pyro4.test.echoserver:main',
'pyro4-check-config = Pyro4.configuration:main',
'pyro4-flameserver = Pyro4.utils.flameserver:main',
'pyro4-httpgateway = Pyro4.utils.httpgateway:main'
'pyro4-ns=Pyro4.naming:main',
'pyro4-nsc=Pyro4.nsc:main',
'pyro4-test-echoserver=Pyro4.test.echoserver:main',
'pyro4-check-config=Pyro4.configuration:main',
'pyro4-flameserver=Pyro4.utils.flameserver:main',
'pyro4-httpgateway=Pyro4.utils.httpgateway:main'
]
},
"options": {"install": {"optimize": 0}}
}

setup(**setupargs)
options={"install": {"optimize": 0}}
)

if len(sys.argv) >= 2 and sys.argv[1].startswith("install"):
print("\nOnly the Pyro library has been installed (version %s)." % pyro4_version)
Expand Down
4 changes: 3 additions & 1 deletion tests/PyroTests/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,9 @@ def testContextAndSock(self):
if not os.path.isdir(cert_dir):
cert_dir = "../certs"
if not os.path.isdir(cert_dir):
self.fail("cannot locate test certs directory")
cert_dir = "./certs"
if not os.path.isdir(cert_dir):
self.fail("cannot locate test certs directory")
try:
config.SSL = True
config.SSL_REQUIRECLIENTCERT = True
Expand Down

0 comments on commit b68e84e

Please sign in to comment.