Skip to content

Commit

Permalink
Release v3.0.2 (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
evhub authored May 30, 2023
2 parents cd78358 + 5ca9eb5 commit 603a27f
Show file tree
Hide file tree
Showing 36 changed files with 1,686 additions and 1,301 deletions.
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,3 @@ repos:
- --aggressive
- --experimental
- --ignore=W503,E501,E722,E402
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
hooks:
- id: add-trailing-comma
35 changes: 35 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

formats: all

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
# formats:
# - pdf

# Optionally declare the Python requirements required to build your docs
python:
install:
- method: pip
path: .
extra_requirements:
- docs
system_packages: true
10 changes: 0 additions & 10 deletions .readthedocs.yml

This file was deleted.

7 changes: 5 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,11 @@ After you've tested your changes locally, you'll want to add more permanent test
6. Check [Codebeat](https://codebeat.co/a/evhub/projects) and [LGTM](https://lgtm.com/dashboard) for `coconut` and `compiled-cocotest`
7. Make sure [`coconut-develop`](https://pypi.python.org/pypi/coconut-develop) package looks good
8. Run `make docs` and ensure local documentation looks good
9. Make sure [develop documentation](http://coconut.readthedocs.io/en/develop/) looks good
10. Make sure [Github Actions](https://github.com/evhub/coconut/actions) and [AppVeyor](https://ci.appveyor.com/project/evhub/coconut) are passing
9. Make sure all of the following are passing:
1. [Github Actions](https://github.com/evhub/coconut/actions)
2. [AppVeyor](https://ci.appveyor.com/project/evhub/coconut)
3. [readthedocs](https://readthedocs.org/projects/coconut/builds/)
10. Make sure [develop documentation](http://coconut.readthedocs.io/en/develop/) looks good
11. Turn off `develop` in `root.py`
12. Set `root.py` to new version number
13. If major release, set `root.py` to new version name
Expand Down
151 changes: 106 additions & 45 deletions DOCS.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ If you don't get the reference, the image above is from [Monty Python and the Ho

### Who developed Coconut?

[Evan Hubinger](https://github.com/evhub) is a [full-time AGI safety researcher](https://www.alignmentforum.org/users/evhub) at the [Machine Intelligence Research Institute](https://intelligence.org/). He can be reached by asking a question on [Coconut's Gitter chat room](https://gitter.im/evhub/coconut), through email at <evanjhub@gmail.com>, or on [LinkedIn](https://www.linkedin.com/in/ehubinger).
[Evan Hubinger](https://github.com/evhub) is an [AI safety research scientist](https://www.alignmentforum.org/users/evhub) at [Anthropic](https://www.anthropic.com/). He can be reached by asking a question on [Coconut's Gitter chat room](https://gitter.im/evhub/coconut), through email at <evanjhub@gmail.com>, or on [LinkedIn](https://www.linkedin.com/in/ehubinger).
2 changes: 1 addition & 1 deletion HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Compiling single files is not the only way to use the Coconut command-line utili

The Coconut compiler supports a large variety of different compilation options, the help for which can always be accessed by entering `coconut -h` into the command line. One of the most useful of these is `--line-numbers` (or `-l` for short). Using `--line-numbers` will add the line numbers of your source code as comments in the compiled code, allowing you to see what line in your source code corresponds to a line in the compiled code where an error occurred, for ease of debugging.

_Note: If you don't need the full control of the Coconut compiler, you can also [access your Coconut code just by importing it](./DOCS.md#automatic-compilation), either from the Coconut interpreter, or in any Python file where you import [`coconut.convenience`](./DOCS.md#coconut-convenience)._
_Note: If you don't need the full control of the Coconut compiler, you can also [access your Coconut code just by importing it](./DOCS.md#automatic-compilation), either from the Coconut interpreter, or in any Python file where you import [`coconut.api`](./DOCS.md#coconut-api)._

### Using IPython/Jupyter

Expand Down
60 changes: 34 additions & 26 deletions __coconut__/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ License: Apache 2.0
Description: MyPy stub file for __coconut__.py.
"""

import sys
import typing as _t

# -----------------------------------------------------------------------------------------------------------------------
# TYPE VARS:
# -----------------------------------------------------------------------------------------------------------------------

import sys
import typing as _t

_Callable = _t.Callable[..., _t.Any]
_Iterable = _t.Iterable[_t.Any]
_Tuple = _t.Tuple[_t.Any, ...]
Expand Down Expand Up @@ -55,21 +55,14 @@ _P = _t.ParamSpec("_P")
class _SupportsIndex(_t.Protocol):
def __index__(self) -> int: ...


# -----------------------------------------------------------------------------------------------------------------------
# IMPORTS:
# -----------------------------------------------------------------------------------------------------------------------

if sys.version_info >= (3, 11):
from typing import dataclass_transform as _dataclass_transform
if sys.version_info >= (3,):
import builtins as _builtins
else:
try:
from typing_extensions import dataclass_transform as _dataclass_transform
except ImportError:
dataclass_transform = ...

import _coconut as __coconut # we mock _coconut as a package since mypy doesn't handle namespace classes very well
_coconut = __coconut
import __builtin__ as _builtins

if sys.version_info >= (3, 2):
from functools import lru_cache as _lru_cache
Expand All @@ -81,13 +74,24 @@ if sys.version_info >= (3, 7):
from dataclasses import dataclass as _dataclass
else:
@_dataclass_transform()
def _dataclass(cls: t_coype[_T], **kwargs: _t.Any) -> type[_T]: ...
def _dataclass(cls: type[_T], **kwargs: _t.Any) -> type[_T]: ...

if sys.version_info >= (3, 11):
from typing import dataclass_transform as _dataclass_transform
else:
try:
from typing_extensions import dataclass_transform as _dataclass_transform
except ImportError:
dataclass_transform = ...

try:
from typing_extensions import deprecated as _deprecated # type: ignore
except ImportError:
def _deprecated(message: _t.Text) -> _t.Callable[[_T], _T]: ... # type: ignore

import _coconut as __coconut # we mock _coconut as a package since mypy doesn't handle namespace classes very well
_coconut = __coconut


# -----------------------------------------------------------------------------------------------------------------------
# STUB:
Expand Down Expand Up @@ -153,18 +157,18 @@ py_repr = repr
py_breakpoint = breakpoint

# all py_ functions, but not py_ types, go here
chr = chr
hex = hex
input = input
map = map
oct = oct
open = open
print = print
range = range
zip = zip
filter = filter
reversed = reversed
enumerate = enumerate
chr = _builtins.chr
hex = _builtins.hex
input = _builtins.input
map = _builtins.map
oct = _builtins.oct
open = _builtins.open
print = _builtins.print
range = _builtins.range
zip = _builtins.zip
filter = _builtins.filter
reversed = _builtins.reversed
enumerate = _builtins.enumerate


_coconut_py_str = py_str
Expand Down Expand Up @@ -435,13 +439,17 @@ def recursive_iterator(func: _T_iter_func) -> _T_iter_func:
return func


# if sys.version_info >= (3, 12):
# from typing import override
# else:
try:
from typing_extensions import override as _override # type: ignore
override = _override
except ImportError:
def override(func: _Tfunc) -> _Tfunc:
return func


def _coconut_call_set_names(cls: object) -> None: ...


Expand Down
Loading

0 comments on commit 603a27f

Please sign in to comment.