Skip to content

Commit

Permalink
Migrate to Python 3, default to tcl 8.6, release v0.4
Browse files Browse the repository at this point in the history
Fixes #4
  • Loading branch information
aidanhs committed Oct 25, 2020
1 parent 74ff715 commit 020cbba
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 93 deletions.
3 changes: 2 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
0.4 - unreleased
0.4

* Expose the tcl interpreter in a Python module.
* Allow importing libtclpy in a parent Python interpreter.
* Added 'tclpy.eval' command for Python.
* Updated to Python 3

0.3 - 2014-08-13

Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PACKAGE_VERSION = 0.3
PACKAGE_VERSION = 0.4

DFLAGS = -DPACKAGE_VERSION='"$(PACKAGE_VERSION)"'

Expand Down Expand Up @@ -32,9 +32,9 @@ CFLAGS = \

TCL_STUBS ?= 1
TCLCONFIG ?= $(shell \
(X=/usr/lib/tclConfig.sh; test -f $$X && echo $$X || exit 1) || \
(X=/usr/lib/tcl8.6/tclConfig.sh; test -f $$X && echo $$X || exit 1) || \
(X=/usr/lib64/tclConfig.sh; test -f $$X && echo $$X || exit 1) || \
(X=/usr/lib/tcl8.5/tclConfig.sh; test -f $$X && echo $$X || exit 1) || \
(X=/usr/lib/tclConfig.sh; test -f $$X && echo $$X || exit 1) || \
echo "" \
)
TCLCONFIG_TEST = test -f "$(TCLCONFIG)" || (echo "Couldn't find tclConfig.sh" && exit 1)
Expand All @@ -47,10 +47,10 @@ TCL_LIB = $(shell . "$(TCLCONFIG)"; \
fi \
)
TCL_INCLUDE = $(shell . "$(TCLCONFIG)"; echo $$TCL_INCLUDE_SPEC)
PY_LIB = $(shell python-config --libs)
PY_INCLUDE = $(shell python-config --includes)
PY_LIB = $(shell python3-config --libs)
PY_INCLUDE = $(shell python3-config --includes)

PY_LIBFILE = $(shell python -c 'import distutils.sysconfig; print distutils.sysconfig.get_config_var("LDLIBRARY")')
PY_LIBFILE = $(shell python3 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_var("LDLIBRARY"))')
CFLAGS += -DPY_LIBFILE='"$(PY_LIBFILE)"'

default: libtclpy$(PACKAGE_VERSION).so
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ libtclpy
========

This is a Tcl extension to effortlessly to call bidirectionally between Tcl and
Python, targeting Tcl >= 8.5 and Python 2.6 - 2.7.
Python, targeting Tcl >= 8.5 and Python 3.6+

The extension is available under the 3-clause BSD license (see "LICENSE").

Expand Down Expand Up @@ -135,10 +135,12 @@ Reference:

example python session:

```
>>> import tclpy
>>> a = tclpy.eval('list 1 [list 2 4 5] 3')
>>> print a
1 {2 4 5} 3
```

UNIX BUILD
----------
Expand Down Expand Up @@ -217,7 +219,6 @@ In order of priority:
- http://stackoverflow.com/questions/1150373/compile-the-python-interpreter-statically
- allow statically compiling
- check threading compatibility
- Python 3
- let `py eval` work with indented multiline blocks
- `py import ?-from module? module : -> nil`
- return the short error line in the catch err variable and put the full stack
Expand Down
Loading

0 comments on commit 020cbba

Please sign in to comment.