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

Updated README, CHANGELOG and INSTALL to use pyswip.org #175

Merged
merged 9 commits into from
Oct 12, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: "Run tests with Python ${{ matrix.python-version }} on ${{ matrix.os }}"
strategy:
matrix:
python-version: [ '3.8', '3.12', '3.13.0-rc.1' ]
python-version: [ '3.8', '3.12', '3.13' ]
os: [ "ubuntu-22.04", "ubuntu-24.04" ]
fail-fast: false

Expand Down
122 changes: 2 additions & 120 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,121 +1,3 @@
# CHANGELOG
# Change Log

### 0.3.1 (Not Released)

### 0.3.0

* Improve list representations, unicode support and multiple threading usage, see: [97](https://github.com/yuce/pyswip/pull/97). Contributed by Guglielmo Gemignani.
* Added PL_STRINGS_MARK to getAtomChars, fixes [102](https://github.com/yuce/pyswip/issues/102). Contributed by Vince Jankovics.
* Backwards compatibility for Python 2 64bit, see: [104](https://github.com/yuce/pyswip/pull/104). Contributed by Tobias Grubenmann.
* Improved handling of lists, nested lists, strings, and atoms. see: [112](https://github.com/yuce/pyswip/pull/112). Contributed by Tobias Grubenmann.
* Fixes for changed constants, see: [125](https://github.com/yuce/pyswip/pull/125). Contributed by Arvid Norlander.
* Refactored SWI-Prolog discovery [commit](https://github.com/yuce/pyswip/commit/d399f0d049ff17200b1b7e1cd878faf3e48502dc)
* Dictionary support, see: [commit](https://github.com/yuce/pyswip/commit/59016e0841f56177d1b18ec08fd9b67792bd0a97). Contributed by Max Peltzer.
* Check `PILLIBSWIPL` environment variable for the `libswipl` library path [145](https://github.com/yuce/pyswip/pull/145). Contributed by Jan Wielemaker.
* Avoid AttributeError with PL_version_info in swipl <= 8.4.2 [154](https://github.com/yuce/pyswip/pull/154). Contributed by Jan DestyNova.
* Added hardcoded path for `libswipl.so` [43](https://github.com/yuce/pyswip/pull/43). Contributed by Kumar Abhinav.
* Fixed not finding swipl lib file when there are multiple options [153](https://github.com/yuce/pyswip/pull/153). Contributed by AdiHarif.

### 0.2.10

* Synchronized type constants with SWI-Prolog.h
update for broken compatibility changes in SWI-Prolog.h up to 0.8.3.
* Fix incorrect REP_* constants.
* Fixed issue [#92](https://github.com/yuce/pyswip/issues/92) (C assert)
* Fixed issue [#90](https://github.com/yuce/pyswip/issues/90) (quoted string)
* Fixed Variables in foreign functions not unifiable. Contributed by Michael Kasch.
* Added support multibyte strings and atoms. Contributed by Nikolai Merinov.
* Updated core.py and easy.py for unifying strings properly. Contributed by rohanshekhar.
* Fixed issue [#71](https://github.com/yuce/pyswip/issues/71). Contributed by prologrules.
* Fixed compatibility with SWI-Prolog 8.2.0. Contributed by Stuart Reynolds.
* Fixed compatibility with MacOS. Contributed by prologrules and Dylan Lukes.

### 0.2.9

* Added non deterministic foreign function support. Contributed by rmanhaeve.
* Fixed issue [#67](https://github.com/yuce/pyswip/pull/67). Contributed by Galileo Sartor.

### 0.2.8

* Fixed issue [#35](https://github.com/yuce/pyswip/issues/35). Contributed by Robert Simione.

### 0.2.7

* Works on FreeBSD.

### 0.2.6

* Fixed issue [#9](https://github.com/yuce/pyswip/issues/9).
* Fixed issue [#10](https://github.com/yuce/pyswip/issues/10).

### 0.2.5

* Project cleanup
* Updated the examples for Python 3.

### 0.2.4

* Maintenance release of PySwip
* Added an error to avoid opening nested queries using PySwip (SWI-Prolog does
not allow that). The error is NestedQueryError.
* Added Tomasz Gryszkiewicz's patch for better finding the SWI-Prolog lib in
Darwin
* Solved issue 4 "Patch for a dynamic method"
* Solved issue 5 "Patch: hash and eq methods for Atom class"
* Solved issue 3: "Problem with variables in lists"
* Solved issue 17: "Can't find SWI-Prolog library in Homebrew's /usr/local"

### 0.2.3

* Maintenance release of PySwip
* Solved issue "Segmentation fault when assertz-ing" (thanks to jpthompson23)
* Solved issue "pyswip doesn't work on cygwin"
* Solved issue "Callbacks can cause segv's" (thanks to jpthompson23)
* Solved issue "Improve library loading"
* Solved issue "sys.exit does not work when importing pyswip"

### 0.2.2

* PySwip won't rely on the (id of the) functor handle of `=/2`.
* Sebastian Höhn's patch to enable PySwip to work on MAC OS-X is incorporated.

### 0.2.1

* Importing `pyswip` automatically initializes SWI-Prolog.
* Fixed a bug with querying lists with the new interface.

### 0.2.0

* All names are included with `from pyswip import ...`
* New *Pythonic* interface
* Prolog.query returns real Python datatypes
* Markus Triska's Sudoku Solver
* Prolog module support
* Foreign functions retrieve Python datatypes.

### 0.1.3

* Renamed `pyswip/util.py` to `pyswip/prolog.py`.
* New module `pyswip.easy`.
* Now it is possible to register a Python function as a Prolog predicate
through SWI-Prolog's Foreign Function Interface.
* Additions to the core library.
* Added example, *register foreign* which shows how to register a Python
function as an SWI-Prolog predicate.
* Added example, *Towers of Hanoi*

### 0.1.2

* Renamed `PrologRunner` to `Prolog`.
* Removed `query` method of `Prolog`, `queryGenerator` is renamed as `query`.
* Added `asserta`, `assertz` and `consult` methods to `Prolog`.
* The necessary cleanup is done even if the `query` generator doesn't run to the end.
* Errors during the execution of `query` is caught and `PrologError` is raised.
* Many new additions to the core library.
* Added `examples` directory.
* Added examples, *coins* and *draughts*.

### 0.1.1

* Added `queryGenerator` to PrologRunner, `query` calls `queryGenerator`.
* Added example `send more money`.
This content has moved to [PySwip Change Log](https://pyswip.org/change-log.html)
151 changes: 1 addition & 150 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,152 +1,3 @@
# Installing PySwip

## Requirements

* Python 3.8 or later
* SWI-Prolog 8.4.2 or later
* 64bit Intel or ARM processor

> [!IMPORTANT]
> Make sure the SWI-Prolog architecture is the same as the Python architecture.
> If you are using a 64bit build of Python, use a 64bit build of SWI-Prolog, etc.

## Installing on All Platforms

PySwip is available to install from [Python Package Index](https://pypi.org/project/pyswip/).

> [!NOTE]
> We recommend installing PySwip into a Python virtual environment.
> See: [Creation of virtual environments](https://docs.python.orgs/3/library/venv.html)

You can install PySwip using:
```
pip install pyswip
```

You will need to have SWI-Prolog installed on your system.
Some operating systems have packages for SWI-Prolog.
Otherwise, you can download it from [SWI-Prolog's website](https://www.swi-prolog.org/Download.html) or build from source.

PySwip requires the location of the `libswpl` shared library and also the SWI-Prolog home directory.
In many cases, PySwip can find the shared library and the home directory automatically.
Otherwise, you can use the following environment variables:
* `SWI_HOME_DIR` - The SWI-Prolog home directory.
* `LIBSWIPL_PATH` - The location of the `libswipl` shared library.

You can get the locations mentioned above using the following commands:
```
swipl --dump-runtime-variables
```

That will output something like:
```
PLBASE="/home/yuce/swipl-9.3.8/lib/swipl";
...
PLLIBDIR="/home/yuce/swipl-9.3.8/lib/swipl/lib/x86_64-linux";
```
Use the value in the `PLBASE` variable as the value for the `SWI_HOME_DIR` environment variable.
Use the value in the `PLLIBDIR` variable as the value for the `LIBSWIPL_PATH` environment variable.

## Installing on Linux

### Arch Linux

Installing SWI-Prolog:
```
pacman -S swi-prolog
```

Installing PySwip:
(Alternative to the `pip install` way explained above)
```
pacman -S python-pyswip
```

### Fedora Workstation

Installing SWI-Prolog:
```
dnf install pl
```

Installing PySwip:
(Alternative to the `pip install` way explained above)
```
dnf install python3-pyswip
```

### Manjaro Linux

Same as the Arch Linux instructions.
See: https://manjaristas.org/branch_compare?q=pyswip

### Parabola GNU/Linux-libre

Same as the Arch Linux instructions.
See: https://www.parabola.nu/packages/?q=python-pyswip

### Debian, Ubuntu, Raspbian

Ubuntu 22.04 has SWI-Prolog 8.4.3 in its repository.
Debian Bookworm, Ubuntu 24.04 and Raspberry Pi OS Bookworm have SWI-Prolog 9.0.4 in their repositories.

To install PySwip, use the `pip install` way explained above.

## Windows

Download a recent version of SWI-Prolog from https://www.swi-prolog.org/Download.html and install it.

To install PySwip, use the `pip install` way explained above.

## MacOS

The preferred way of installing SWI-Prolog on MacOS is using [Homebrew](https://brew.sh).

### Homebrew

Installing SWI-Prolog:
```
brew install swi-prolog
```

To install PySwip, use the `pip install` way explained above.

### Official SWI-Prolog App

Install SWI-Prolog from https://www.swi-prolog.org/Download.html.

If you get an error like `libgmp.X not found`, you have to set the `DYLD_FALLBACK_LIBRARY_PATH` environment variable before running Python:
```
export DYLD_FALLBACK_LIBRARY_PATH=/Applications/SWI-Prolog.app/Contents/Frameworks
```

To install PySwip, use the `pip install` way explained above.

## Other UNIX

### OpenBSD

Install SWI-Prolog using the following on OpenBSD 7.6 and later:
```
pkg_add swi-prolog
```

To install PySwip, use the `pip install` way explained above.

### FreeBSD

SWI-Prolog can be installed using `pkg`:
```
pkg install swi-pl
```

To install PySwip, use the `pip install` way explained above.

## Test Drive

Run a quick test by running following code at your Python console:
```python
from pyswip import Prolog
prolog = Prolog()
prolog.assertz("father(michael,john)")
```
This content has moved to [PySwip Get Started](https://pyswip.org/get-started.html)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2007-2020 Yüce Tekol and PySwip contributors
Copyright (c) 2007-2024 Yüce Tekol and PySwip contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
Loading