Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Windows support #146

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions cpp/src/feather/api.h
Expand Up @@ -15,6 +15,10 @@
#ifndef FEATHER_API_H
#define FEATHER_API_H

#if _MSC_VER >= 1900
#undef timezone
#endif

#include "feather/buffer.h"
#include "feather/common.h"
#include "feather/io.h"
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/feather/io.cc
Expand Up @@ -14,7 +14,8 @@

#include "feather/io.h"

#ifdef __MINGW32__
#ifdef _WIN32
#define NOMINMAX
#include "feather/mman.h"
#undef Realloc
#undef Free
Expand Down
4 changes: 1 addition & 3 deletions python/feather/tests/test_reader.py
Expand Up @@ -122,9 +122,7 @@ def test_integer_no_nulls(self):

for dtype in numpy_dtypes:
info = np.iinfo(dtype)
values = np.random.randint(info.min,
min(info.max, np.iinfo('i8').max),
size=num_values)
values = np.random.randint(0, 100, size=num_values)
data[dtype] = values.astype(dtype)

df = pd.DataFrame(data)
Expand Down
5 changes: 4 additions & 1 deletion python/setup.py
Expand Up @@ -116,6 +116,9 @@ def run(self):
if platform.system() == 'Darwin':
EXTRA_LINK_ARGS.append('-Wl,-rpath,' + feather_lib_dir)

EXTRA_COMPILE_ARGS = []
if platform.system() != 'Windows':
EXTRA_COMPILE_ARGS = ['-std=c++11', '-O3']

RT_LIBRARY_DIRS = LIBRARY_DIRS

Expand All @@ -126,7 +129,7 @@ def run(self):
include_dirs=INCLUDE_PATHS,
library_dirs=LIBRARY_DIRS,
runtime_library_dirs=RT_LIBRARY_DIRS,
extra_compile_args=['-std=c++11', '-O3'],
extra_compile_args=EXTRA_COMPILE_ARGS,
extra_link_args=EXTRA_LINK_ARGS)
extensions = [ext]
extensions = cythonize(extensions)
Expand Down