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

Update readthedocs configuration #97

Merged
merged 5 commits into from
Nov 21, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.11", "pypy3.10"]
minizinc-version: ["2.7.6", "2.6.0"]
python-version: ["3.8", "3.11", "pypy3.10"]
minizinc-version: ["2.8.0", "2.6.0"]

env:
MINIZINC_URL: https://github.com/MiniZinc/MiniZincIDE/releases/download/${{ matrix.minizinc-version }}/MiniZincIDE-${{ matrix.minizinc-version }}-x86_64.AppImage
Expand Down
33 changes: 29 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
# .readthedocs.yml
# Read the Docs configuration file
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
version: 3.7
install:
- requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements:
- docs
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ this project adheres to `Semantic Versioning <https://semver.org/>`_.
Unreleased_
------------

Removed
^^^^^^^

- **BREAKING:** The project no longer supports Python 3.7. This change will make
it easier to manage MiniZinc Python's build system.

Changed
^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ To get a MiniZinc Python up and running follow these simple steps.

_MiniZinc Python_ can be installed by running `pip install minizinc`. It
requires [MiniZinc](https://www.minizinc.org/) 2.6+ and
[Python](https://www.python.org/) 3.7+ to be installed on the system. MiniZinc
[Python](https://www.python.org/) 3.8+ to be installed on the system. MiniZinc
python expects the `minizinc` executable to be available on the executable path,
the `$PATH` environmental variable, or in a default installation location.

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This page will guide you through the process of setting up MiniZinc Python.
MiniZinc Python requires the following software to be installed on you machine:

- `MiniZinc <https://www.minizinc.org/>`_ 2.6 (or higher)
- `Python <https://www.python.org/>`_ 3.7 (or higher)
- `Python <https://www.python.org/>`_ 3.8 (or higher)

.. note::

Expand Down
2 changes: 0 additions & 2 deletions docs/requirements.txt

This file was deleted.

1,618 changes: 706 additions & 912 deletions poetry.lock

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,25 @@ classifiers = [
"Bug Tracker" = "https://github.com/MiniZinc/minizinc-python/issues"

[tool.poetry.dependencies]
python = "^3.7"
python = "^3.8"
# DZN Parser extra `pip install minizinc[dzn]
lark-parser = { version = "^0.12.0", optional = true }
# Docs extra (for readthedocs)
sphinx = { version = "^7.1", optional = true }
sphinx-rtd-theme = { version = "^1.0.0", optional = true }

[tool.poetry.group.dev.dependencies]
black = "*"
isort = "^5.9"
tox = "^3.24"
tox-poetry-installer = { version = "^0.10.0", extras = ["poetry"] }
isort = "^5.12"
tox = "^4.11"
tox-poetry-installer = { version = "^1.0.0b1", extras = [
"poetry",
], allow-prereleases = true }

[tool.poetry.group.ci]
optional = true
[tool.poetry.group.ci.dependencies]
tox-gh-actions = "^2.7.0" # CI distribution
tox-gh-actions = "^3.1.3" # CI distribution

[tool.poetry.group.ext]
optional = true
Expand All @@ -58,14 +64,9 @@ types-setuptools = "^65.3.0"
pytest = "^7.1"
ruff = "^0.0.126"

[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
sphinx = ">=4.2,<6.0"
sphinx-rtd-theme = "^1.0.0"

[tool.poetry.extras]
dzn = ["lark-parser"]
docs = ["sphinx", "sphinx-rtd-theme"]

[tool.poetry.plugins."pygments.lexers"]
minizinclexer = "minizinc.pygments:MiniZincLexer"
Expand All @@ -84,7 +85,7 @@ target-version = ['py37', 'py38', 'py39', 'py310']
profile = "black"

[tool.mypy]
python_version = "3.7"
python_version = "3.8"
platform = "linux"

# do not follow imports (except for ones found in typeshed)
Expand Down
3 changes: 1 addition & 2 deletions src/minizinc/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,7 @@ async def solutions(
assert isinstance(proc.stderr, asyncio.StreamReader)
assert isinstance(proc.stdout, asyncio.StreamReader)

# Python 3.7+: replace with asyncio.create_task
read_stderr = asyncio.ensure_future(_read_all(proc.stderr))
read_stderr = asyncio.create_task(_read_all(proc.stderr))

async for obj in decode_async_json_stream(
proc.stdout, cls=MZNJSONDecoder, enum_map=self._enum_map
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ envlist =

[gh-actions]
python =
3.7: py37
3.10: py310, check
pypy3.7: pypy3
3.8: py38
3.12: py312, check
pypy3.10: pypy3

[testenv]
require_locked_deps = true
Expand Down
Loading