Skip to content

Commit

Permalink
Version 0.6.1
Browse files Browse the repository at this point in the history
Fix for #10.
Also updates to test on PyPy as well.
Updating install_requires in setup.py
  • Loading branch information
hbldh committed Nov 17, 2017
1 parent 3171608 commit cfb6afc
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ python:
- 3.5
- 3.6
- "nightly"
- "pypy"
- "pypy3"
matrix:
allow_failures:
- python: "nightly"
- python: "pypy"
- python: "pypy3"
branches:
only:
Expand Down
47 changes: 23 additions & 24 deletions bankid/certutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import subprocess
import requests

from bankid.exceptions import BankIDError

_TEST_CERT_PASSWORD = 'qwerty123'
_TEST_CERT_URL = "https://www.bankid.com/assets/bankid/rp/FPTestcert2_20150818_102329.pfx"

Expand Down Expand Up @@ -69,34 +71,31 @@ def split_certificate(certificate_path, destination_folder, password=None):
:rtype: tuple
"""
try: # pragma: no cover
# Attempt Linux call first
try:
# Attempt Linux and Darwin call first.
p = subprocess.Popen(['openssl', 'version'], stdout=subprocess.PIPE)
sout, serr = p.communicate()
if not sout.decode().lower().startswith('openssl'):
raise NotImplementedError(
"OpenSSL executable could not be found. "
"Splitting cannot be performed.")
openssl_executable_version = sout.decode().lower()
if not (openssl_executable_version.startswith('openssl') or
openssl_executable_version.startswith('libressl')):
raise BankIDError("OpenSSL executable could not be found. "
"Splitting cannot be performed.")
print(sout.strip())
openssl_executable = 'openssl'
except: # pragma: no cover
try: # pragma: no cover
# Attempt to call on standard Git for Windows path.
p = subprocess.Popen(['C:\\Program Files\\Git\\mingw64\\bin\\openssl.exe', 'version'],
stdout=subprocess.PIPE)
sout, serr = p.communicate()
if not sout.decode().lower().startswith('openssl'):
raise NotImplementedError(
"OpenSSL executable could not be found. "
"Splitting cannot be performed.")
print(sout.strip())
openssl_executable = 'C:\\Program Files\\Git\\mingw64\\bin\\openssl.exe'
except: # pragma: no cover
raise NotImplementedError(
"OpenSSL executable could not be found. "
"Splitting cannot be performed.")

if not os.path.exists(os.path.abspath(os.path.expanduser(destination_folder))): # pragma: no cover
except BankIDError:
# Attempt to call on standard Git for Windows path.
p = subprocess.Popen(
['C:\\Program Files\\Git\\mingw64\\bin\\openssl.exe', 'version'],
stdout=subprocess.PIPE)
sout, serr = p.communicate()
if not sout.decode().lower().startswith('openssl'):
raise BankIDError("OpenSSL executable could not be found. "
"Splitting cannot be performed.")
print(sout.strip())
openssl_executable = 'C:\\Program Files\\Git\\mingw64\\bin\\openssl.exe'

if not os.path.exists(os.path.abspath(
os.path.expanduser(destination_folder))):
os.makedirs(os.path.abspath(os.path.expanduser(destination_folder)))

# Paths to output files.
Expand Down
2 changes: 1 addition & 1 deletion bankid/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
from __future__ import print_function
from __future__ import absolute_import

__version__ = '0.6.0'
__version__ = '0.6.1'
version = __version__ # backwards compatibility name
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ def read(f):
return open(f, encoding='utf-8').read()


REQUIRES = [
"requests",
"zeep",
"six"
]

setup(
name='pybankid',
version=version,
Expand Down Expand Up @@ -64,7 +70,7 @@ def read(f):
platforms=['any'],
packages=find_packages(exclude=('tests', )),
package_data={'': ['*.pem']},
install_requires=read('requirements.txt').strip().splitlines(),
install_requires=REQUIRES,
dependency_links=[],
ext_modules=[],
extras_require={
Expand Down

0 comments on commit cfb6afc

Please sign in to comment.