Skip to content

Commit

Permalink
more python changes
Browse files Browse the repository at this point in the history
- More robust virtualenv version detection

- Versioning adjustment as dictated in
  https://www.python.org/dev/peps/pep-0440/ after suggestions by
  @heikoheiko

- Pep8 style changes in setup.py
  • Loading branch information
LefterisJP committed Apr 1, 2015
1 parent 3e28a57 commit a586e26
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 36 deletions.
63 changes: 32 additions & 31 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
#!/usr/bin/env python
from distutils.core import setup, Extension

pyethash = Extension('pyethash',
sources = [
'src/python/core.c',
'src/libethash/util.c',
'src/libethash/internal.c',
'src/libethash/sha3.c'],
depends = [
'src/libethash/ethash.h',
'src/libethash/compiler.h',
'src/libethash/data_sizes.h',
'src/libethash/endian.h',
'src/libethash/ethash.h',
'src/libethash/fnv.h',
'src/libethash/internal.h',
'src/libethash/sha3.h',
'src/libethash/util.h'
],
extra_compile_args = ["-Isrc/", "-std=gnu99", "-Wall"])

setup (
name = 'pyethash',
author = "Matthew Wampler-Doty",
author_email = "matthew.wampler.doty@gmail.com",
license = 'GPL',
version = '23',
url = 'https://github.com/ethereum/ethash',
download_url = 'https://github.com/ethereum/ethash/tarball/v23',
description = 'Python wrappers for ethash, the ethereum proof of work hashing function',
ext_modules = [pyethash],
)

pyethash = Extension('pyethash',
sources=[
'src/python/core.c',
'src/libethash/util.c',
'src/libethash/internal.c',
'src/libethash/sha3.c'],
depends=[
'src/libethash/ethash.h',
'src/libethash/compiler.h',
'src/libethash/data_sizes.h',
'src/libethash/endian.h',
'src/libethash/ethash.h',
'src/libethash/fnv.h',
'src/libethash/internal.h',
'src/libethash/sha3.h',
'src/libethash/util.h'
],
extra_compile_args=["-Isrc/", "-std=gnu99", "-Wall"])

setup(
name='pyethash',
author="Matthew Wampler-Doty",
author_email="matthew.wampler.doty@gmail.com",
license='GPL',
version='0.1.23',

This comment has been minimized.

Copy link
@chfast

chfast Jan 28, 2016

Member

Why have you changed the version here?

This comment has been minimized.

Copy link
@LefterisJP

LefterisJP Jan 28, 2016

Author Contributor

I don't remember exactly. Had something to do with the format that python packages expected the version to be .. or something like that. In any case I recall that the pyethash package is unmaintained since mathew has not given ownership to anyone else.

This comment has been minimized.

Copy link
@chfast

chfast Jan 28, 2016

Member

It is a bit strange as PyPi package available has version 0.1.27.

This comment has been minimized.

Copy link
@LefterisJP

LefterisJP Jan 28, 2016

Author Contributor

no idea to be honest, it has been a long time since then. If anyone wants to take it over ask mathew and maybe something can be done.

This comment has been minimized.

Copy link
@chfast

chfast Jan 28, 2016

Member

Who is Mathew?

This comment has been minimized.

Copy link
@LefterisJP

LefterisJP Jan 28, 2016

Author Contributor

let's move this to either email or gitter.

url='https://github.com/ethereum/ethash',
download_url='https://github.com/ethereum/ethash/tarball/v23',
description=('Python wrappers for ethash, the ethereum proof of work'
'hashing function'),
ext_modules=[pyethash],
)
2 changes: 1 addition & 1 deletion src/python/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ calc_dataset_bytes(PyObject *self, PyObject *args) {
free(mem);
return val;
}
#define DEB(...) printf(__VA_ARGS__); fflush(stdout);

// hashimoto_light(full_size, cache, header, nonce)
static PyObject *
hashimoto_light(PyObject *self, PyObject *args) {
Expand Down
10 changes: 6 additions & 4 deletions test/python/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# Strict mode
set -e

# just a specific case for archlinux where python3 is the default
if [ -f "/etc/arch-release" ]; then
VIRTUALENV_EXEC=virtualenv2
if [ -x "$(which virtualenv2)" ] ; then
VIRTUALENV_EXEC=virtualenv2
elif [ -x "$(which virtualenv)" ] ; then
VIRTUALENV_EXEC=virtualenv
else
VIRTUALENV_EXEC=virtualenv
echo "Could not find a suitable version of virtualenv"
false
fi

SOURCE="${BASH_SOURCE[0]}"
Expand Down

0 comments on commit a586e26

Please sign in to comment.