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

Moved pyskycoin to lib/swig #134

Open
wants to merge 5 commits into
base: 0.25.dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .fuse_hidden0003358400000017
Binary file not shown.
15 changes: 12 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
# general things to ignore
lib/swig/build/
build/
lib/swig/dist/
dist/
*.egg-info/
*.egg
*.eggs
*.py[cod]
lib/swig/__pycache__/
__pycache__/
lib/swig/.pytest_cache
.pytest_cache
*.so
*.o
*.orig
lib/swig/Pyskycoin-*
Pyskycoin-*
lib/swig/eggs
eggs
lib/swig/wheelhouse/
wheelhouse/

*fuse*
*~

#Copy of libskycoin.h in pyskycoin
swig/include/libskycoin.h
lib/swig/swig/include/libskycoin.h

#Just for testing outside tox
tests/mytest.py
lib/swig/tests/mytest.py

# due to using tox and pytest
.tox
lib/swig/.tox
.cache
lib/swig/.cache

# Temp files
*.swp
Expand Down
36 changes: 19 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ SKYCOIN_DIR = gopath/src/github.com/skycoin/skycoin
SKYBUILD_DIR = $(SKYCOIN_DIR)/build
BUILDLIBC_DIR = $(SKYBUILD_DIR)/libskycoin
LIBC_DIR = $(SKYCOIN_DIR)/lib/cgo
LIBSWIG_DIR = swig
LIBSWIG_DIR = lib/swig/swig
LIBSWIG_PYSKYCOIN = lib/swig
BUILD_DIR = build
DIST_DIR = dist
BIN_DIR = $(SKYCOIN_DIR)/bin
Expand Down Expand Up @@ -42,9 +43,9 @@ $(BUILDLIBC_DIR)/libskycoin.a: $(LIB_FILES) $(SRC_FILES) $(HEADER_FILES)
rm -f $(BUILDLIBC_DIR)/libskycoin.a
GOPATH="$(GOPATH_DIR)" make -C $(SKYCOIN_DIR) build-libc-static
ls $(BUILDLIBC_DIR)
rm -f swig/include/libskycoin.h
mkdir -p swig/include
grep -v _Complex $(INCLUDE_DIR)/libskycoin.h > swig/include/libskycoin.h
rm -f $(LIBSWIG_PYSKYCOIN)/swig/include/libskycoin.h
mkdir -p $(LIBSWIG_PYSKYCOIN)/swig/include
grep -v _Complex $(INCLUDE_DIR)/libskycoin.h > $(LIBSWIG_PYSKYCOIN)/swig/include/libskycoin.h

build-libc: configure $(BUILDLIBC_DIR)/libskycoin.a ## Build libskycoin C client library

Expand All @@ -60,36 +61,37 @@ build-swig: ## Generate Python C module from SWIG interfaces
sed -i 's/#/%/g' $(LIBSWIG_DIR)/structs.i ;\
fi \
}
rm -f ./skycoin/skycoin.py
rm -f swig/pyskycoin_wrap.c
rm -f swig/include/swig.h
cp -v gopath/src/github.com/skycoin/skycoin/include/swig.h swig/include/
swig -python -Iswig/include -I$(INCLUDE_DIR) -outdir ./skycoin/ -o swig/pyskycoin_wrap.c $(LIBSWIG_DIR)/pyskycoin.i
rm -f $(LIBSWIG_PYSKYCOIN)/skycoin/skycoin.py
rm -f $(LIBSWIG_PYSKYCOIN)/swig/pyskycoin_wrap.c
rm -f $(LIBSWIG_PYSKYCOIN)/swig/include/swig.h
cp -v gopath/src/github.com/skycoin/skycoin/include/swig.h $(LIBSWIG_PYSKYCOIN)/swig/include/
swig -python -Ilib/swig/swig/include -I$(shell pwd)/gopath/src/github.com/skycoin/skycoin/include -outdir $(LIBSWIG_PYSKYCOIN)/skycoin/ -o $(LIBSWIG_PYSKYCOIN)/swig/pyskycoin_wrap.c $(LIBSWIG_DIR)/pyskycoin.i

develop: ## Install PySkycoin for development
$(PYTHON) setup.py develop
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py develop)
$(PYTHON) $(PYTHON_CLIENT_DIR)/setup.py develop \
(cd $(LIBSWIG_PYSKYCOIN) && $(PYTHON) setup.py develop)

build-libc-swig: build-libc build-swig

build: build-libc-swig ## Build PySkycoin Python package
$(PYTHON) setup.py build
$(PYTHON) $(LIBSWIG_PYSKYCOIN)/setup.py build
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py build)

test-ci: ## Run tests on (Travis) CI build
tox
(cd $(PYTHON_CLIENT_DIR) && tox)
(cd $(PYTHON_CLIENT_DIR) && tox)


test: build-libc build-swig develop ## Run project test suite
$(PYTHON) setup.py test
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py test)
$(PYTHON) $(PYTHON_CLIENT_DIR)/setup.py test \
(cd $(LIBSWIG_PYSKYCOIN) && $(PYTHON) setup.py test)

sdist: ## Create source distribution archive
$(PYTHON) setup.py sdist --formats=gztar
$(PYTHON) $(LIBSWIG_PYSKYCOIN)/setup.py sdist --formats=gztar \
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py sdist --formats=gztar)

bdist_wheel: ## Create architecture-specific binary wheel distribution archive
$(PYTHON) setup.py bdist_wheel
$(PYTHON) $(LIBSWIG_PYSKYCOIN)/setup.py bdist_wheel \
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py bdist_wheel)

# FIXME: After libskycoin 32-bits binaries add bdist_manylinux_i686
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in → lib/swig/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ recursive-include gopath/src/github.com/skycoin/skycoin/include *
recursive-exclude . *.orig
exclude .github
exclude .travis
exclude lib/skyapi
exclude .pytest_cache
recursive-exclude .github *
recursive-exclude .travis *
recursive-exclude lib/skyapi *
recursive-exclude .pytest_cache *

File renamed without changes.
Empty file added lib/swig/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading