Skip to content
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
31 changes: 11 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,6 @@ commands:
path: junit

jobs:
test-pypy-36:
docker:
- image: pypy:3.6-slim-buster
parallelism: 8
steps:
- run_pypy_tests:
python_version: "3.6"

test-pypy-37:
docker:
- image: pypy:3.7-slim-buster
parallelism: 8
steps:
- run_pypy_tests:
python_version: "3.7"

test-pypy-38:
docker:
- image: pypy:3.8-slim-buster
Expand All @@ -64,17 +48,24 @@ jobs:

test-pypy-39:
docker:
- image: pypy:3.9-slim-buster
- image: pypy:3.9-slim-bookworm
parallelism: 8
steps:
- run_pypy_tests:
python_version: "3.9"

test-pypy-310:
docker:
- image: pypy:3.10-slim-bookworm
parallelism: 8
steps:
- run_pypy_tests:
python_version: "3.10"

workflows:
version: 2
test:
jobs:
- test-pypy-36
- test-pypy-37
- test-pypy-38
- test-pypy-39
- test-pypy-39
- test-pypy-310
16 changes: 8 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ '3.6', '3.7', '3.8', '3.9', '3.10' ]
version: ['3.8', '3.9', '3.10']
include:
- version: '3.6'
tox-env: py36,py36-mypy,py36-lint,safety
- version: '3.7'
tox-env: py37,py37-mypy,py37-lint,safety
- version: '3.8'
tox-env: py38,py38-mypy,py38-lint,safety
- version: '3.9'
Expand Down Expand Up @@ -59,8 +55,8 @@ jobs:
with:
name: code-coverage
path: coverage/.coverage.py*

report-coverage:
environment: CI
runs-on: ubuntu-latest
needs: run-tests
steps:
Expand Down Expand Up @@ -89,7 +85,11 @@ jobs:
uses: actions/download-artifact@v3
with:
name: code-coverage
- name: Report coverage
- name: Combine Coverage files from all supported Python versions
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: tox -v -e coverage
run: tox -v -e coverage
- name: Report Combined Coverage
uses: coverallsapp/github-action@v2
with:
file: coverage.xml
5 changes: 5 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.10"

sphinx:
configuration: docs/conf.py

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Other
* Run CPython CI checks on Github Actions rather than CircleCI (#683)
* Remove support for Python 3.6 and 3.7, which are both EOL

## [v0.1.0a1]
### Added
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repl:
.PHONY: test
test:
@rm -f .coverage*
@TOX_SKIP_ENV='pypy3|safety|coverage' poetry run tox -p 4
@TOX_SKIP_ENV='pypy3|safety|coverage' poetry run tox run-parallel -p 4


lispcore.py:
Expand All @@ -43,5 +43,5 @@ pypy-shell:
@docker run -it \
--mount src=`pwd`,target=/usr/src/app,type=bind \
--workdir /usr/src/app \
pypy:3.6-7.3-slim-buster \
pypy:3.10-7.3-slim-buster \
/bin/sh -c 'pip install -e . && basilisp repl'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🐍 basilisp 🐍

A Clojure-compatible(-ish) Lisp dialect targeting Python 3.6+.
A Clojure-compatible(-ish) Lisp dialect targeting Python 3.8+.

[![PyPI](https://img.shields.io/pypi/v/basilisp.svg?style=flat-square)](https://pypi.org/project/basilisp/) [![python](https://img.shields.io/pypi/pyversions/basilisp.svg?style=flat-square)](https://pypi.org/project/basilisp/) [![pyimpl](https://img.shields.io/pypi/implementation/basilisp.svg?style=flat-square)](https://pypi.org/project/basilisp/) [![readthedocs](https://img.shields.io/readthedocs/basilisp.svg?style=flat-square)](https://basilisp.readthedocs.io/) [![CircleCI]( https://img.shields.io/circleci/project/github/basilisp-lang/basilisp/master.svg?style=flat-square)](https://circleci.com/gh/basilisp-lang/basilisp) [![Run tests](https://github.com/basilisp-lang/basilisp/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/basilisp-lang/basilisp/actions/workflows/run-tests.yml) [![Coveralls github](https://img.shields.io/coveralls/github/basilisp-lang/basilisp.svg?style=flat-square)](https://coveralls.io/github/basilisp-lang/basilisp) [![license](https://img.shields.io/github/license/basilisp-lang/basilisp.svg?style=flat-square)](https://github.com/basilisp-lang/basilisp/blob/master/LICENSE)

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# -- Project information -----------------------------------------------------

project = "Basilisp"
copyright = "2018-2020, Chris Rink"
copyright = "2018-2023, Chris Rink"
author = "Chris Rink"

# The short X.Y version
Expand Down
2 changes: 1 addition & 1 deletion docs/differencesfromclojure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Hosted on Python
----------------

Unlike Clojure, Basilisp is hosted on the Python VM.
Basilisp supports versions of Python 3.6+.
Basilisp supports versions of Python 3.8+.
Basilisp projects and libraries may both import Python code and be imported by Python code (once the Basilisp runtime has been :ref:`initialized <bootstrapping>` and the import hooks have been installed).

.. _type_differences:
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Welcome to Basilisp's documentation!
====================================

Basilisp is a :ref:`Clojure-compatible(-ish) <differences_from_clojure>` Lisp dialect targeting Python 3.6+.
Basilisp is a :ref:`Clojure-compatible(-ish) <differences_from_clojure>` Lisp dialect targeting Python 3.8+.

Basilisp compiles down to raw Python 3 code and executes on the Python 3 virtual machine, allowing natural interoperability between existing Python libraries and new Lisp code.

Expand Down
4 changes: 2 additions & 2 deletions docs/reader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,13 @@ Splicing reader conditionals may only appear within other collection literal for
Python Version Reader Features
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Basilisp includes a specialized set of reader features based on the major version of Python (e.g. 3.6, 3.7, etc.).
Basilisp includes a specialized set of reader features based on the major version of Python (e.g. 3.8, 3.9, etc.).
Because the API of Python's standard library changes significantly between versions, it can be challenging to support multiple versions at once.
In classical Python, users are forced to use conditional gates either at the top level of a module to define different function versions, or perhaps gate the logic within a function or class.
Both options incur some level of runtime cost.
The Python version features allow you to supply version specific overrides from the reader forward, meaning only the specific code for the version of Python you are using will be compiled and hit at runtime.

The version specific feature for Python 3.6 is ``:lpy36`` while the feature for Python 3.10 is ``:lpy310``.
The version specific feature for Python 3.8 is ``:lpy38`` while the feature for Python 3.10 is ``:lpy310``.

In addition to the features that lock to specific versions, there are also "range" features that allow you to specify all Python versions before or after the specified version.
For example, to select all versions of Python 3.7 or greater, you would use ``:lpy37+``.
Expand Down
10 changes: 2 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ classifiers = [
"License :: OSI Approved :: Eclipse Public License 1.0 (EPL-1.0)",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -30,7 +28,7 @@ classifiers = [
include = ["README.md", "LICENSE"]

[tool.poetry.dependencies]
python = "^3.6"
python = "^3.8"
astor = "^0.8.1"
attrs = ">=20.1.0"
immutables = "^0.15"
Expand All @@ -43,10 +41,7 @@ pytest = { version = "^6.2.5", optional = true }
pygments = { version = "^2.9.0", optional = true }

[tool.poetry.dev-dependencies]
black = [
{version = "==20.8b1", python = ">=3.6.0,<3.6.2"},
{version = "*", python = "^3.6.2"}
]
black = "*"
docutils = "*"
isort = "*"
pygments = "*"
Expand All @@ -55,7 +50,6 @@ pytest-pycharm = "*"
sphinx = "*"
sphinx-rtd-theme = "*"
tox = "*"
tox-pyenv = "*"

[tool.poetry.extras]
pygments = ["pygments"]
Expand Down
2 changes: 1 addition & 1 deletion src/basilisp/contrib/sphinx/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class BasilispNamespaceIndex(Index):
shortname = "namespaces"

def generate( # pylint: disable=too-many-branches,too-many-locals
self, docnames: Iterable[str] = None
self, docnames: Optional[Iterable[str]] = None
) -> Tuple[List[Tuple[str, List[IndexEntry]]], bool]:
content: Dict[str, List[IndexEntry]] = defaultdict(list)

Expand Down
2 changes: 1 addition & 1 deletion src/basilisp/core.lpy
Original file line number Diff line number Diff line change
Expand Up @@ -4646,7 +4646,7 @@
(not
(try
(importlib.util/find-spec (basilisp.lang.util/munge ns-name))
(catch #?(:lpy36- python/AttributeError :lpy37+ python/ModuleNotFoundError) _
(catch python/ModuleNotFoundError _
nil))))
(let [basilisp-ns-name (str (.replace ns-name "clojure" "basilisp" 1))]
;; Add the original name as an alias if no alias was given
Expand Down
5 changes: 3 additions & 2 deletions src/basilisp/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,12 @@ def find_spec(
self,
fullname: str,
path, # Optional[List[str]] # MyPy complains this is incompatible with supertype
target: types.ModuleType = None,
target: Optional[types.ModuleType] = None,
) -> Optional[ModuleSpec]:
"""Find the ModuleSpec for the specified Basilisp module.

Returns None if the module is not a Basilisp module to allow import processing to continue."""
Returns None if the module is not a Basilisp module to allow import processing to continue.
"""
package_components = fullname.split(".")
if not path:
path = sys.path
Expand Down
7 changes: 1 addition & 6 deletions src/basilisp/io.lpy
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,7 @@
(.unlink (as-path f))
true)
([f silently]
#?(:lpy37- (try
(.unlink (as-path f))
(catch python/FileNotFoundError e
(when-not silently
(throw e))))
:lpy38+ (.unlink (as-path f) ** :missing-ok (if silently true false)))
(.unlink (as-path f) ** :missing-ok (if silently true false))
silently))

(defn- clean-reader-mode
Expand Down
1 change: 0 additions & 1 deletion src/basilisp/lang/compiler/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3605,7 +3605,6 @@ def _const_node_type(_: Any) -> ConstType:
uuid.UUID: ConstType.UUID,
vec.PersistentVector: ConstType.VECTOR,
}.items():

_const_node_type.register(tp, lambda _, default=const_type: default)


Expand Down
2 changes: 1 addition & 1 deletion src/basilisp/lang/compiler/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def to_map(self) -> lmap.PersistentMap:
return to_lisp(attr.asdict(self)) # type: ignore[arg-type]

def assoc(self, **kwargs):
return attr.evolve(self, **kwargs)
return attr.evolve(self, **kwargs) # type: ignore[misc]

def visit(self, f: Callable[..., None], *args, **kwargs):
"""Visit all immediate children of this node, calling
Expand Down
12 changes: 6 additions & 6 deletions src/basilisp/lang/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,15 @@ class IIndexed(ICounted, ABC):
__slots__ = ()


# Making this interface Generic causes the __repr__ to differ between
# Python 3.6 and 3.7, which affects a few simple test assertions.
# Since there is little benefit to this type being Generic, I'm leaving
# it as is for now.
class IExceptionInfo(Exception, ABC):
T_ExceptionInfo = TypeVar("T_ExceptionInfo", bound="IPersistentMap")


class IExceptionInfo(Exception, Generic[T_ExceptionInfo], ABC):
__slots__ = ()

@property
@abstractmethod
def data(self) -> "IPersistentMap":
def data(self) -> T_ExceptionInfo:
raise NotImplementedError()


Expand Down Expand Up @@ -307,6 +306,7 @@ def seq(self) -> "Optional[ISeq[T]]": # type: ignore[override]

T_tcoll = TypeVar("T_tcoll", bound="ITransientCollection", covariant=True)


# Including ABC as a base seems to cause catastrophic meltdown.
class IEvolveableCollection(Generic[T_tcoll]):
@abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion src/basilisp/lang/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
try:
from immutables._map import MapMutation # pylint: disable=unused-import
except ImportError:
from immutables.map import MapMutation # type: ignore[misc]
from immutables.map import MapMutation # type: ignore[assignment]


T = TypeVar("T")
Expand Down
20 changes: 10 additions & 10 deletions src/basilisp/lang/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ class ReaderContext:
def __init__( # pylint: disable=too-many-arguments
self,
reader: StreamReader,
resolver: Resolver = None,
data_readers: DataReaders = None,
resolver: Optional[Resolver] = None,
data_readers: Optional[DataReaders] = None,
eof: Any = None,
features: Optional[IPersistentSet[kw.Keyword]] = None,
process_reader_cond: bool = True,
Expand Down Expand Up @@ -1497,8 +1497,8 @@ def _read_next(ctx: ReaderContext) -> LispReaderForm: # noqa: C901 MC0001

def syntax_quote( # pylint: disable=too-many-arguments
form: RawReaderForm,
resolver: Resolver = None,
data_readers: DataReaders = None,
resolver: Optional[Resolver] = None,
data_readers: Optional[DataReaders] = None,
eof: Any = EOF,
features: Optional[IPersistentSet[kw.Keyword]] = None,
process_reader_cond: bool = True,
Expand All @@ -1519,8 +1519,8 @@ def syntax_quote( # pylint: disable=too-many-arguments

def read( # pylint: disable=too-many-arguments
stream,
resolver: Resolver = None,
data_readers: DataReaders = None,
resolver: Optional[Resolver] = None,
data_readers: Optional[DataReaders] = None,
eof: Any = EOF,
is_eof_error: bool = False,
features: Optional[IPersistentSet[kw.Keyword]] = None,
Expand Down Expand Up @@ -1573,8 +1573,8 @@ def read( # pylint: disable=too-many-arguments

def read_str( # pylint: disable=too-many-arguments
s: str,
resolver: Resolver = None,
data_readers: DataReaders = None,
resolver: Optional[Resolver] = None,
data_readers: Optional[DataReaders] = None,
eof: Any = EOF,
is_eof_error: bool = False,
features: Optional[IPersistentSet[kw.Keyword]] = None,
Expand All @@ -1598,8 +1598,8 @@ def read_str( # pylint: disable=too-many-arguments

def read_file( # pylint: disable=too-many-arguments
filename: str,
resolver: Resolver = None,
data_readers: DataReaders = None,
resolver: Optional[Resolver] = None,
data_readers: Optional[DataReaders] = None,
eof: Any = EOF,
is_eof_error: bool = False,
features: Optional[IPersistentSet[kw.Keyword]] = None,
Expand Down
Loading