From 16d0cd99ef956b077bd3b1c526b64cc3c2123778 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Mon, 16 Jul 2018 22:26:17 -0400 Subject: [PATCH 01/30] pushing wheel to dropbox --- .travis.yml | 16 +++++++++++----- dropbox-deployment.yml | 4 ++++ 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 dropbox-deployment.yml diff --git a/.travis.yml b/.travis.yml index 1c828bcbc..a02388d96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,25 @@ +os: osx + matrix: include: - - os: osx - osx_image: xcode9.3beta - env: - - MATRIX_EVAL="" + - osx_image: xcode9.3 + - osx_image: xcode8.3 + - osx_image: xcode7.3 before_install: - - eval "${MATRIX_EVAL}" + - rvm install 2.2.6 + - gem install dropbox-deployment - brew update - brew bundle - env install: + - python3 setup.py build - python3 setup.py install + - python3 setup.py bdist_wheel script: - python3 -c 'import klayout.db as db; print(dir(db))' - python3 -c 'import klayout.rdb as rdb; print(dir(rdb))' - python3 -c 'import klayout.tl as tl; print(dir(tl))' +after_success: + - dropbox-deployment diff --git a/dropbox-deployment.yml b/dropbox-deployment.yml new file mode 100644 index 000000000..945f867d8 --- /dev/null +++ b/dropbox-deployment.yml @@ -0,0 +1,4 @@ +deploy: + dropbox_path: /Builds/klayout-pymod # The path to the folder on Dropbox where the files will go + artifacts_path: dist # can be a single file, or a path + debug: true # if you want to see more logs From 1086795a55858ed0705fb99cd0ed40e7fb7b6461 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Mon, 16 Jul 2018 22:44:06 -0400 Subject: [PATCH 02/30] travis different c++ compilers for older OS --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index a02388d96..66c1ef48a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,14 +3,21 @@ os: osx matrix: include: - osx_image: xcode9.3 + env: + - MATRIX_EVAL="" - osx_image: xcode8.3 + env: + - MATRIX_EVAL="brew install gcc && CC=gcc-7 && CXX=g++-7" - osx_image: xcode7.3 + env: + - MATRIX_EVAL="brew install gcc && CC=gcc-7 && CXX=g++-7" before_install: - rvm install 2.2.6 - gem install dropbox-deployment - brew update - brew bundle + - eval "${MATRIX_EVAL}" - env install: From f2c083c1342a09bbe421f3bde0fd050a66836c8c Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Mon, 16 Jul 2018 22:53:27 -0400 Subject: [PATCH 03/30] fixing travis yml --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 66c1ef48a..a48728051 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,14 +3,14 @@ os: osx matrix: include: - osx_image: xcode9.3 - env: - - MATRIX_EVAL="" + env: + - MATRIX_EVAL="" - osx_image: xcode8.3 - env: - - MATRIX_EVAL="brew install gcc && CC=gcc-7 && CXX=g++-7" + env: + - MATRIX_EVAL="brew install gcc && CC=gcc-7 && CXX=g++-7" - osx_image: xcode7.3 - env: - - MATRIX_EVAL="brew install gcc && CC=gcc-7 && CXX=g++-7" + env: + - MATRIX_EVAL="brew install gcc && CC=gcc-7 && CXX=g++-7" before_install: - rvm install 2.2.6 From 015f1d92e5b99171e37d7fdda794c4d1e7448172 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Mon, 16 Jul 2018 23:01:49 -0400 Subject: [PATCH 04/30] fixing gcc compilation --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a48728051..cb8f350be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,18 +7,18 @@ matrix: - MATRIX_EVAL="" - osx_image: xcode8.3 env: - - MATRIX_EVAL="brew install gcc && CC=gcc-7 && CXX=g++-7" + - MATRIX_EVAL="brew install gcc || brew link --overwrite gcc; export CC=gcc-7 && export CXX=g++-7" - osx_image: xcode7.3 env: - - MATRIX_EVAL="brew install gcc && CC=gcc-7 && CXX=g++-7" + - MATRIX_EVAL="brew install gcc || brew link --overwrite gcc; export CC=gcc-7 && export CXX=g++-7" before_install: + - env - rvm install 2.2.6 - gem install dropbox-deployment - brew update - brew bundle - eval "${MATRIX_EVAL}" - - env install: - python3 setup.py build From bd9ea2a188e99ae5eb5fa14d51bb3a235bce3426 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Mon, 16 Jul 2018 23:12:05 -0400 Subject: [PATCH 05/30] fixing gcc compilation --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index cb8f350be..d4bb6df34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,10 +7,10 @@ matrix: - MATRIX_EVAL="" - osx_image: xcode8.3 env: - - MATRIX_EVAL="brew install gcc || brew link --overwrite gcc; export CC=gcc-7 && export CXX=g++-7" + - MATRIX_EVAL="brew install gcc || brew link --overwrite gcc; export CC=gcc && export CXX=g++" - osx_image: xcode7.3 env: - - MATRIX_EVAL="brew install gcc || brew link --overwrite gcc; export CC=gcc-7 && export CXX=g++-7" + - MATRIX_EVAL="brew install gcc || brew link --overwrite gcc; export CC=gcc && export CXX=g++" before_install: - env From f26576099c0c0d699b047337517626ca7c8c4422 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Mon, 16 Jul 2018 23:29:51 -0400 Subject: [PATCH 06/30] missing stdlib.h import --- .travis.yml | 10 +++++----- src/tl/tl/tlLog.cc | 45 +++++++++++++++++++++++---------------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index d4bb6df34..ea2e2bfb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,15 +2,15 @@ os: osx matrix: include: - - osx_image: xcode9.3 + - osx_image: xcode9.3 # macOS 10.13 env: - MATRIX_EVAL="" - - osx_image: xcode8.3 + - osx_image: xcode8.3 # macOS 10.12 env: - - MATRIX_EVAL="brew install gcc || brew link --overwrite gcc; export CC=gcc && export CXX=g++" - - osx_image: xcode7.3 + - MATRIX_EVAL="" + - osx_image: xcode7.3 # macOS 10.11 env: - - MATRIX_EVAL="brew install gcc || brew link --overwrite gcc; export CC=gcc && export CXX=g++" + - MATRIX_EVAL="" before_install: - env diff --git a/src/tl/tl/tlLog.cc b/src/tl/tl/tlLog.cc index f251191c8..1c8cace45 100644 --- a/src/tl/tl/tlLog.cc +++ b/src/tl/tl/tlLog.cc @@ -26,6 +26,7 @@ #include #include +#include #if defined(_WIN32) # include @@ -64,13 +65,13 @@ static int default_verbosity () static int m_verbosity_level = default_verbosity (); -void +void verbosity (int level) { m_verbosity_level = level; } -int +int verbosity () { return m_verbosity_level; @@ -79,7 +80,7 @@ verbosity () // ------------------------------------------------ // Channel implementation -Channel::Channel () +Channel::Channel () : m_no_endl (false), m_active (false) { // .. nothing else .. @@ -90,7 +91,7 @@ Channel::~Channel () // .. nothing yet .. } -ChannelProxy +ChannelProxy Channel::issue_proxy () { m_no_endl = false; @@ -102,7 +103,7 @@ Channel::issue_proxy () return ChannelProxy (this); } -void +void Channel::release_proxy () { if (! m_no_endl) { @@ -130,7 +131,7 @@ LogTee::LogTee (Channel *first, bool owned) add (first, owned); } -void +void LogTee::add (Channel *other, bool owned) { m_lock.lock (); @@ -161,7 +162,7 @@ LogTee::clear () m_lock.unlock (); } -void +void LogTee::puts (const char *s) { try { @@ -173,7 +174,7 @@ LogTee::puts (const char *s) } } -void +void LogTee::endl () { try { @@ -185,7 +186,7 @@ LogTee::endl () } } -void +void LogTee::end () { try { @@ -197,7 +198,7 @@ LogTee::end () } } -void +void LogTee::begin () { try { @@ -292,7 +293,7 @@ InfoChannel::~InfoChannel () // .. nothing yet .. } -void +void InfoChannel::puts (const char *s) { if (verbosity () >= m_verbosity) { @@ -300,7 +301,7 @@ InfoChannel::puts (const char *s) } } -void +void InfoChannel::endl () { if (verbosity () >= m_verbosity) { @@ -308,7 +309,7 @@ InfoChannel::endl () } } -void +void InfoChannel::end () { if (verbosity () >= m_verbosity) { @@ -319,7 +320,7 @@ InfoChannel::end () } } -void +void InfoChannel::begin () { if (verbosity () >= m_verbosity) { @@ -362,19 +363,19 @@ WarningChannel::~WarningChannel () // .. nothing yet .. } -void +void WarningChannel::puts (const char *s) { fputs (s, stdout); } -void +void WarningChannel::endl () { fputs ("\n", stdout); } -void +void WarningChannel::end () { if (m_colorized) { @@ -383,7 +384,7 @@ WarningChannel::end () fflush (stdout); } -void +void WarningChannel::begin () { if (m_colorized) { @@ -426,19 +427,19 @@ ErrorChannel::~ErrorChannel () // .. nothing yet .. } -void +void ErrorChannel::puts (const char *s) { fputs (s, stderr); } -void +void ErrorChannel::endl () { fputs ("\n", stderr); } -void +void ErrorChannel::end () { if (m_colorized) { @@ -447,7 +448,7 @@ ErrorChannel::end () fflush (stderr); } -void +void ErrorChannel::begin () { if (m_colorized) { From 771eb8410749d17f7cde63bc39751df7d382de3d Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Mon, 16 Jul 2018 23:42:37 -0400 Subject: [PATCH 07/30] issue with CLOCK_REALTIME, trying xcode8 for macOS 10.11 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ea2e2bfb6..1b47e2d71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ matrix: - osx_image: xcode8.3 # macOS 10.12 env: - MATRIX_EVAL="" - - osx_image: xcode7.3 # macOS 10.11 + - osx_image: xcode8 # macOS 10.11 env: - MATRIX_EVAL="" From 8d2c2d430d8c61dc04b259d8c9478b2f79e7011b Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Tue, 17 Jul 2018 11:49:26 -0400 Subject: [PATCH 08/30] Updated ruby version in travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1b47e2d71..3341fabdd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ matrix: before_install: - env - - rvm install 2.2.6 + - rvm install ruby --latest - gem install dropbox-deployment - brew update - brew bundle From 20db1e1f2498b82cf300c381f5cb6d2d8b8a9ae8 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Tue, 17 Jul 2018 14:05:33 -0400 Subject: [PATCH 09/30] Added support for Mac OS X 10.11 and lower --- src/tl/tl/tlThreads.cc | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/tl/tl/tlThreads.cc b/src/tl/tl/tlThreads.cc index 4dc6ed49e..24ea37d06 100644 --- a/src/tl/tl/tlThreads.cc +++ b/src/tl/tl/tlThreads.cc @@ -34,10 +34,33 @@ #if defined(_WIN32) # include #endif +#if defined(__MACH__) +#include +#include +#endif namespace tl { +// ------------------------------------------------------------------------------- +// clock_gettime is not implemented in Mac OS X 10.11 and lower +// From: https://gist.githubusercontent.com/jbenet/1087739/raw/638b37f76cdd9dc46d617443cab27eac297e2ee3/current_utc_time.c + +void current_utc_time(struct timespec *ts) { + +#if defined(__MACH__) + clock_serv_t cclock; + mach_timespec_t mts; + host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); + clock_get_time(cclock, &mts); + mach_port_deallocate(mach_task_self(), cclock); + ts->tv_sec = mts.tv_sec; + ts->tv_nsec = mts.tv_nsec; +#else + clock_gettime(CLOCK_REALTIME, ts); +#endif + +} // ------------------------------------------------------------------------------- // WaitCondition implementation @@ -270,7 +293,7 @@ bool Thread::wait (unsigned long time) if (time < std::numeric_limits::max ()) { struct timespec end_time; - clock_gettime (CLOCK_REALTIME, &end_time); + current_utc_time (&end_time); end_time.tv_sec += (time / 1000); end_time.tv_nsec += (time % 1000) * 1000000; From 106b57c6765281b2790704f58301b66178f79395 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Tue, 17 Jul 2018 14:14:47 -0400 Subject: [PATCH 10/30] Fixed unchanged functions --- src/tl/tl/tlThreads.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tl/tl/tlThreads.cc b/src/tl/tl/tlThreads.cc index 24ea37d06..70aa11f6c 100644 --- a/src/tl/tl/tlThreads.cc +++ b/src/tl/tl/tlThreads.cc @@ -105,7 +105,7 @@ public: if (time < std::numeric_limits::max ()) { struct timespec end_time; - clock_gettime (CLOCK_REALTIME, &end_time); + current_utc_time (&end_time); end_time.tv_sec += (time / 1000); end_time.tv_nsec += (time % 1000) * 1000000; @@ -308,7 +308,7 @@ bool Thread::wait (unsigned long time) while (isRunning ()) { struct timespec current_time; - clock_gettime (CLOCK_REALTIME, ¤t_time); + current_utc_time (¤t_time); if (end_time.tv_sec < current_time.tv_sec || (end_time.tv_sec == current_time.tv_sec && end_time.tv_nsec < current_time.tv_nsec)) { return false; } From 5f6c265e4baa7b7ada085088e626de80c6155723 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Tue, 17 Jul 2018 14:37:41 -0400 Subject: [PATCH 11/30] Moved current_utc_time to tlUtils and fixed tlTimer --- src/tl/tl/tlThreads.cc | 25 +------------------------ src/tl/tl/tlTimer.cc | 6 +++--- src/tl/tl/tlUtils.h | 27 +++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/tl/tl/tlThreads.cc b/src/tl/tl/tlThreads.cc index 70aa11f6c..239dcaa5f 100644 --- a/src/tl/tl/tlThreads.cc +++ b/src/tl/tl/tlThreads.cc @@ -23,44 +23,21 @@ #if !defined(HAVE_QT) #include "tlThreads.h" +#include "tlUtils.h" #include "tlLog.h" #include "tlInternational.h" #include #include -#include #include #include #if defined(_WIN32) # include #endif -#if defined(__MACH__) -#include -#include -#endif namespace tl { -// ------------------------------------------------------------------------------- -// clock_gettime is not implemented in Mac OS X 10.11 and lower -// From: https://gist.githubusercontent.com/jbenet/1087739/raw/638b37f76cdd9dc46d617443cab27eac297e2ee3/current_utc_time.c - -void current_utc_time(struct timespec *ts) { - -#if defined(__MACH__) - clock_serv_t cclock; - mach_timespec_t mts; - host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); - clock_get_time(cclock, &mts); - mach_port_deallocate(mach_task_self(), cclock); - ts->tv_sec = mts.tv_sec; - ts->tv_nsec = mts.tv_nsec; -#else - clock_gettime(CLOCK_REALTIME, ts); -#endif - -} // ------------------------------------------------------------------------------- // WaitCondition implementation diff --git a/src/tl/tl/tlTimer.cc b/src/tl/tl/tlTimer.cc index de3181891..c8058f30e 100644 --- a/src/tl/tl/tlTimer.cc +++ b/src/tl/tl/tlTimer.cc @@ -22,6 +22,7 @@ #include "tlTimer.h" +#include "tlUtils.h" #include "tlLog.h" #include "tlString.h" @@ -30,7 +31,6 @@ #endif #include -#include #ifndef _MSC_VER // not available on MS VC++ # include @@ -45,7 +45,7 @@ namespace tl static int64_t ms_time () { struct timespec spec; - clock_gettime (CLOCK_REALTIME, &spec); + current_utc_time (&spec); return int64_t (spec.tv_sec) * 1000 + int64_t (0.5 + spec.tv_nsec / 1.0e6); } @@ -77,7 +77,7 @@ Timer::start () #endif struct timespec spec; - clock_gettime (CLOCK_REALTIME, &spec); + current_utc_time (&spec); m_wall_ms += ms_time (); } diff --git a/src/tl/tl/tlUtils.h b/src/tl/tl/tlUtils.h index 84bdf5a5f..498fd4fd1 100644 --- a/src/tl/tl/tlUtils.h +++ b/src/tl/tl/tlUtils.h @@ -27,10 +27,37 @@ #include "tlAssert.h" #include +#include + +#if defined(__MACH__) +#include +#include +#endif namespace tl { +/** +* @brief clock_gettime is not implemented in Mac OS X 10.11 and lower +* From: https://gist.githubusercontent.com/jbenet/1087739/raw/638b37f76cdd9dc46d617443cab27eac297e2ee3/current_utc_time.c +*/ + +inline void current_utc_time(struct timespec *ts) { + +#if defined(__MACH__) + clock_serv_t cclock; + mach_timespec_t mts; + host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); + clock_get_time(cclock, &mts); + mach_port_deallocate(mach_task_self(), cclock); + ts->tv_sec = mts.tv_sec; + ts->tv_nsec = mts.tv_nsec; +#else + clock_gettime(CLOCK_REALTIME, ts); +#endif + +} + /** * @brief A template class mapping a begin .. end iterator pair to the at_end semantics */ From 68e0560e0c7265dced4ee676b6384f83284e6e29 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Tue, 17 Jul 2018 15:47:30 -0400 Subject: [PATCH 12/30] Added Linux builds for Travis --- .travis.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3341fabdd..7f8682877 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,32 +1,35 @@ -os: osx - matrix: include: - - osx_image: xcode9.3 # macOS 10.13 - env: - - MATRIX_EVAL="" - - osx_image: xcode8.3 # macOS 10.12 - env: - - MATRIX_EVAL="" - - osx_image: xcode8 # macOS 10.11 - env: - - MATRIX_EVAL="" + - os: linux + dist: trusty # Ubuntu 14.04 + sudo: false + - osx_image: xcode9.3 # macOS 10.13 + env: + - MATRIX_EVAL="" + - osx_image: xcode8.3 # macOS 10.12 + env: + - MATRIX_EVAL="" + - osx_image: xcode8 # macOS 10.11 + env: + - MATRIX_EVAL="" before_install: - env - rvm install ruby --latest - gem install dropbox-deployment - - brew update - - brew bundle + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew bundle; fi - eval "${MATRIX_EVAL}" install: - python3 setup.py build - python3 setup.py install - python3 setup.py bdist_wheel + script: - python3 -c 'import klayout.db as db; print(dir(db))' - python3 -c 'import klayout.rdb as rdb; print(dir(rdb))' - python3 -c 'import klayout.tl as tl; print(dir(tl))' + after_success: - dropbox-deployment From 182517dbf9a904b36289766061fce7cb458ac6e2 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 13:38:31 -0400 Subject: [PATCH 13/30] Retry Ubuntu builds on Travis --- .travis.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7f8682877..7cebfdd06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,13 +3,18 @@ matrix: - os: linux dist: trusty # Ubuntu 14.04 sudo: false - - osx_image: xcode9.3 # macOS 10.13 env: - MATRIX_EVAL="" - - osx_image: xcode8.3 # macOS 10.12 + - os: osx + osx_image: xcode9.3 # macOS 10.13 env: - MATRIX_EVAL="" - - osx_image: xcode8 # macOS 10.11 + - os: osx + osx_image: xcode8.3 # macOS 10.12 + env: + - MATRIX_EVAL="" + - os: osx + osx_image: xcode8 # macOS 10.11 env: - MATRIX_EVAL="" From fcb3575b72c56be1d334e35a00ea56893e16fa8e Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 13:54:55 -0400 Subject: [PATCH 14/30] Added setuptools installation to travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 7cebfdd06..2afe80736 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,7 @@ before_install: - eval "${MATRIX_EVAL}" install: + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip install --user setuptools; fi - python3 setup.py build - python3 setup.py install - python3 setup.py bdist_wheel From 0b2e56fcbf6684d1d495cf4f605ce78601990102 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 14:03:48 -0400 Subject: [PATCH 15/30] Fixed wrong pip version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2afe80736..ac029b4e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ before_install: - eval "${MATRIX_EVAL}" install: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip install --user setuptools; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip3 install --user setuptools; fi - python3 setup.py build - python3 setup.py install - python3 setup.py bdist_wheel From ebae966237a4c7b9593eafa755a1828c67896da3 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 14:09:24 -0400 Subject: [PATCH 16/30] Use apt to install setuptools instead of pip --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ac029b4e5..1e631ef00 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ matrix: include: - os: linux dist: trusty # Ubuntu 14.04 - sudo: false + sudo: true env: - MATRIX_EVAL="" - os: osx @@ -22,12 +22,12 @@ before_install: - env - rvm install ruby --latest - gem install dropbox-deployment + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install python3-setuptools; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew bundle; fi - eval "${MATRIX_EVAL}" install: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip3 install --user setuptools; fi - python3 setup.py build - python3 setup.py install - python3 setup.py bdist_wheel From a52c629df7762ce00e1a6d5ee5edf78d20c0bf63 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 15:07:36 -0400 Subject: [PATCH 17/30] Use sudo if building on Ubuntu --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1e631ef00..b8df29125 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,8 +29,9 @@ before_install: install: - python3 setup.py build - - python3 setup.py install - python3 setup.py bdist_wheel + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then python3 setup.py install; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo python3 setup.py installs; fi script: - python3 -c 'import klayout.db as db; print(dir(db))' From 5729153e6d4c1a790bbc6c7a8520c57ae98752bd Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 15:24:24 -0400 Subject: [PATCH 18/30] Fixed typo in travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b8df29125..153b106d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ install: - python3 setup.py build - python3 setup.py bdist_wheel - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then python3 setup.py install; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo python3 setup.py installs; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo python3 setup.py install; fi script: - python3 -c 'import klayout.db as db; print(dir(db))' From 8877b93c6ce6d33bbf88a00de8b37df4e5de3f2f Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 15:50:24 -0400 Subject: [PATCH 19/30] Install wheel with pip if using Ubuntu --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 153b106d8..97e60c270 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ before_install: - rvm install ruby --latest - gem install dropbox-deployment - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install python3-setuptools; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo pip install wheel; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew bundle; fi - eval "${MATRIX_EVAL}" From 8cfa1b84d92bf3efa9de2120e1db42f3e108e74a Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 16:18:11 -0400 Subject: [PATCH 20/30] Use apt instead of pip for wheel --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 97e60c270..64690c7b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,7 @@ before_install: - env - rvm install ruby --latest - gem install dropbox-deployment - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install python3-setuptools; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo pip install wheel; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install python3-setuptools python3-wheel; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew bundle; fi - eval "${MATRIX_EVAL}" From 0daa84daddcd7fa0b7448a2b581d05fa30854626 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 17:00:32 -0400 Subject: [PATCH 21/30] Added different python versions to travis --- .travis.yml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 64690c7b8..f4dc8a2ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,17 @@ +language: python +python: + - "3.3" + - "3.4" + - "3.5" + - "3.6" + - "3.6" + - "3.7" + matrix: include: - os: linux dist: trusty # Ubuntu 14.04 - sudo: true + sudo: false env: - MATRIX_EVAL="" - os: osx @@ -22,21 +31,21 @@ before_install: - env - rvm install ruby --latest - gem install dropbox-deployment - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install python3-setuptools python3-wheel; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip install setuptools wheel; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew bundle; fi - eval "${MATRIX_EVAL}" install: - - python3 setup.py build - - python3 setup.py bdist_wheel - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then python3 setup.py install; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo python3 setup.py install; fi + - python setup.py build + - python setup.py bdist_wheel + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then python setup.py install; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo python setup.py install; fi script: - - python3 -c 'import klayout.db as db; print(dir(db))' - - python3 -c 'import klayout.rdb as rdb; print(dir(rdb))' - - python3 -c 'import klayout.tl as tl; print(dir(tl))' + - python -c 'import klayout.db as db; print(dir(db))' + - python -c 'import klayout.rdb as rdb; print(dir(rdb))' + - python -c 'import klayout.tl as tl; print(dir(tl))' after_success: - dropbox-deployment From 1f1906eb3c5c5d31ef301ae36f66603a5e767ab8 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 17:05:47 -0400 Subject: [PATCH 22/30] Moved python configuration inside Linux in travis.yml --- .travis.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index f4dc8a2ef..e871f026b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,16 @@ -language: python -python: - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "3.6" - - "3.7" - matrix: include: - os: linux dist: trusty # Ubuntu 14.04 sudo: false + language: python + python: + - "3.3" + - "3.4" + - "3.5" + - "3.6" + - "3.6" + - "3.7" env: - MATRIX_EVAL="" - os: osx From 91404950712ea243e0610171c88405102bd6806c Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 17:31:31 -0400 Subject: [PATCH 23/30] Separated Python versions in travis.yml --- .travis.yml | 55 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index e871f026b..cdd9948b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,13 +4,47 @@ matrix: dist: trusty # Ubuntu 14.04 sudo: false language: python - python: - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "3.6" - - "3.7" + python: '2.6' + env: + - MATRIX_EVAL="" + - os: linux + dist: trusty # Ubuntu 14.04 + sudo: false + language: python + python: '2.7' + env: + - MATRIX_EVAL="" + - os: linux + dist: trusty # Ubuntu 14.04 + sudo: false + language: python + python: '3.3' + env: + - MATRIX_EVAL="" + - os: linux + dist: trusty # Ubuntu 14.04 + sudo: false + language: python + python: '3.4' + env: + - MATRIX_EVAL="" + - os: linux + dist: trusty # Ubuntu 14.04 + sudo: false + language: python + python: '3.5' + env: + - MATRIX_EVAL="" + - os: linux + dist: trusty # Ubuntu 14.04 + sudo: false + python: '3.6' + env: + - MATRIX_EVAL="" + - os: linux + dist: trusty # Ubuntu 14.04 + sudo: false + python: '3.7' env: - MATRIX_EVAL="" - os: osx @@ -30,16 +64,13 @@ before_install: - env - rvm install ruby --latest - gem install dropbox-deployment - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip install setuptools wheel; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew bundle; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew bundle; alias python='python3'; fi - eval "${MATRIX_EVAL}" install: - python setup.py build - python setup.py bdist_wheel - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then python setup.py install; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo python setup.py install; fi + - python setup.py install script: - python -c 'import klayout.db as db; print(dir(db))' From 5b5f1a050df51cb4925f8afbfc1b80401ea26f1b Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 17:44:48 -0400 Subject: [PATCH 24/30] Fixed missing language declarations in travis.yml --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index cdd9948b8..3604dd85a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,12 +38,14 @@ matrix: - os: linux dist: trusty # Ubuntu 14.04 sudo: false + language: python python: '3.6' env: - MATRIX_EVAL="" - os: linux dist: trusty # Ubuntu 14.04 sudo: false + language: python python: '3.7' env: - MATRIX_EVAL="" From ca6d82f9b7c2e122c8bb5e48c9eca4c67553875c Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 18:24:55 -0400 Subject: [PATCH 25/30] Install sysconfig using pip --- .travis.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3604dd85a..e66d93947 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,13 +42,6 @@ matrix: python: '3.6' env: - MATRIX_EVAL="" - - os: linux - dist: trusty # Ubuntu 14.04 - sudo: false - language: python - python: '3.7' - env: - - MATRIX_EVAL="" - os: osx osx_image: xcode9.3 # macOS 10.13 env: @@ -66,7 +59,7 @@ before_install: - env - rvm install ruby --latest - gem install dropbox-deployment - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew bundle; alias python='python3'; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew bundle; alias python='python3'; else pip install sysconfig; fi - eval "${MATRIX_EVAL}" install: From 24f9f44227322a00b2c8e404b8da75257188a8ec Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 18:27:07 -0400 Subject: [PATCH 26/30] Revert installing sysconfig --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e66d93947..2f47d2ad7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,7 +59,7 @@ before_install: - env - rvm install ruby --latest - gem install dropbox-deployment - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew bundle; alias python='python3'; else pip install sysconfig; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew bundle; alias python='python3'; fi - eval "${MATRIX_EVAL}" install: From 9aa796422e2a0b1de45cf30fc2639adc61b4fe85 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 18:34:28 -0400 Subject: [PATCH 27/30] Print sysconfig location --- .travis.yml | 1 + setup.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2f47d2ad7..33dfa24ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,6 +61,7 @@ before_install: - gem install dropbox-deployment - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew bundle; alias python='python3'; fi - eval "${MATRIX_EVAL}" + - python -c "import distutils.sysconfig as sysconfig; print(sysconfig.__file__)" install: - python setup.py build diff --git a/setup.py b/setup.py index 2ba243d95..faca55e19 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ from setuptools import setup, Extension, Distribution import glob import os import platform -import sysconfig +import distutils.sysconfig as sysconfig # ---------------------------------------------------------------------------------------- @@ -85,6 +85,7 @@ class Config(object): Returns the library name for a given module The library name is usually decorated (i.e. "tl" -> "tl.cpython-35m-x86_64-linux-gnu.so"). """ + print return mod + self.ext_suffix def path_of(self, mod): From 5e1db92102444e243e20812e9e237f0e64edd9a8 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 18:43:58 -0400 Subject: [PATCH 28/30] Continue even if ext_suffix is None --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index faca55e19..ab559776a 100644 --- a/setup.py +++ b/setup.py @@ -78,6 +78,9 @@ class Config(object): self.build_platlib = build_cmd.build_platlib self.ext_suffix = sysconfig.get_config_var("EXT_SUFFIX") + if self.ext_suffix is None: + self.ext_suffix = "" + self.root = "klayout" def libname_of(self, mod): @@ -85,7 +88,6 @@ class Config(object): Returns the library name for a given module The library name is usually decorated (i.e. "tl" -> "tl.cpython-35m-x86_64-linux-gnu.so"). """ - print return mod + self.ext_suffix def path_of(self, mod): From dfa1995f5a48dd788662a89177bb76491b5cca39 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 18:55:45 -0400 Subject: [PATCH 29/30] Make alias work on Travis for Mac OS --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 33dfa24ac..cec6b84c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,7 +59,7 @@ before_install: - env - rvm install ruby --latest - gem install dropbox-deployment - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew bundle; alias python='python3'; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew bundle; shopt -s expand_aliases; alias python='python3'; fi - eval "${MATRIX_EVAL}" - python -c "import distutils.sysconfig as sysconfig; print(sysconfig.__file__)" From bb9fc867353620492f8e5ac84e64e5a8faaa01fa Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 19 Jul 2018 19:02:37 -0400 Subject: [PATCH 30/30] Add .so extension if ext_suffix is None --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index ab559776a..23635782d 100644 --- a/setup.py +++ b/setup.py @@ -79,8 +79,8 @@ class Config(object): self.ext_suffix = sysconfig.get_config_var("EXT_SUFFIX") if self.ext_suffix is None: - self.ext_suffix = "" - + self.ext_suffix = ".so" + self.root = "klayout" def libname_of(self, mod):