Comments (8)
Hi @georgerb, great! There is a branch which contains an initial port to Python 3 available at: https://github.com/eomahony/Numberjack/tree/Python3 Maybe you can give that a try and let us know of any issues?
Ideally, we would like to have a single code base supporting both but we haven't had the resources to investigate this properly. We're using swig for the C++ interfaces, so I haven't investigated if we will run into any issues there etc. If you have any experience with this type of thing, it would be great to hear.
from numberjack.
To unify the codebases Python 2.7.x provides the future package, this helps with the migration and maintains compatibility with previous versions, I will do my research with SWIG and let you.
from numberjack.
I'm also interested in seeing Numberjack work for py3. I have a little experience wrapping C++ interfaces with SWIG, including supporting python2 and python3 with the same codebase: https://github.com/rdeits/swig-eigen-numpy and https://github.com/rdeits/swig-autodiff All my build system experience is in CMake, but your setup.py looks pretty readable. Essentially, the only thing you'll likely need to do is pass the -py3
flag to swig.
You also may come across the fact that python's division operators got renamed a bit in py3 (because of the change from integer division to float division for /
). In my SWIG interface file, I had to add the following in order to wrap operator / for a C++ class in python3:
#ifdef SWIGPYTHON3
%rename(__truediv__) *::operator/;
#endif
The SWIGPYTHON3
symbol is one that I manually define in my CMakeLists.txt when python3 is used.
Other than that, I think everything should just work (famous last words?).
I'll take a look at your branch and see what I can do.
from numberjack.
Actually, it turns out that python's setup.py
appears to just do the right thing under the hood to support python2 and python3 with swig. I've got all the unit tests (except the one that fails on master) and all the examples running in python3 and python2 with the same codebase now: #33
from numberjack.
Closing as python 2+3 is now in master. A new release will follow soon.
from numberjack.
any movement on publishing the python3 version?
from numberjack.
@dandroid88 Numberjack version 1.2.0 has been published on PyPI now. I was waiting to set up a test environment locally to test on both python 2 and 3.
from numberjack.
Fantastic news and very appreciative :) Cheers!
from numberjack.
Related Issues (20)
- Segfault using Table constraint HOT 6
- Support Gurobi Compute Server running in the cloud HOT 1
- Issues with .Mul operator for constraints. HOT 15
- New puzzle examples ready. HOT 1
- Get only the first solution HOT 4
- Confused why solutions do not satisfy constraints... HOT 1
- setup.py is always searching for CPLEX
- Setup fails to find xml2-config on Windows HOT 1
- If statement with constraint HOT 2
- Installation issue HOT 1
- discussion group HOT 1
- AttributeError: 'Element' object has no attribute 'domain_ while trying to add Predicate Sum HOT 1
- Deprecated built-in function __getslice__ in python 3.7 to get a slice from a list
- The docs link is dead :(
- Can't use gurobi on Debian 9 (undefined symbol)
- KeyError: 'f'
- ImportError: No module named '_Mistral' HOT 2
- AttributeError: 'float' object has no attribute 'lb'_
- Solvers not available
- arm64 support? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from numberjack.