Skip to content

Commit

Permalink
docs: upgrade dependencies and fixes (#3745)
Browse files Browse the repository at this point in the history
* docs: Upgrade dependencies

* docs: fixes
  • Loading branch information
BoboTiG authored Jan 30, 2024
1 parent 9002ed2 commit 768b3e9
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 17 deletions.
8 changes: 8 additions & 0 deletions docs/_static/css/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ a:visited {
background-color: #2d2d2d !important;
}

.descname {
color: inherit !important;
}

.rst-content dl:not(.docutils) dt {
color: #aaddff;
border-top: solid 3px #525252;
Expand Down Expand Up @@ -164,6 +168,10 @@ pre {

/* table of contents */

.wy-body-for-nav {
background-color: rgb(26, 28, 29);
}

.wy-nav-content-wrap {
background-color: rgba(0, 0, 0, 0.6) !important;
}
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

# General information about the project.
project = "Vyper"
copyright = "2017-2020 CC-BY-4.0 Vyper Team"
copyright = "2017-2024 CC-BY-4.0 Vyper Team"
author = "Vyper Team (originally created by Vitalik Buterin)"

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -190,5 +190,5 @@
intersphinx_mapping = {
"brownie": ("https://eth-brownie.readthedocs.io/en/stable", None),
"pytest": ("https://docs.pytest.org/en/latest/", None),
"python": ("https://docs.python.org/3.8/", None),
"python": ("https://docs.python.org/3.10/", None),
}
4 changes: 2 additions & 2 deletions docs/control-structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ You cannot put the ``@nonreentrant`` decorator on a ``pure`` function. You can p


The ``__default__`` Function
--------------------------
----------------------------

A contract can also have a default function, which is executed on a call to the contract if no other functions match the given function identifier (or if none was supplied at all, such as through someone sending it Eth). It is the same construct as fallback functions `in Solidity <https://solidity.readthedocs.io/en/latest/contracts.html?highlight=fallback#fallback-function>`_.

Expand Down Expand Up @@ -165,7 +165,7 @@ Lastly, although the default function receives no arguments, it can still access
* the gas provided (``msg.gas``).

The ``__init__`` Function
-----------------------
-------------------------

``__init__`` is a special initialization function that may only be called at the time of deploying a contract. It can be used to set initial values for storage variables. A common use case is to set an ``owner`` variable with the creator the contract:

Expand Down
2 changes: 1 addition & 1 deletion docs/installing-vyper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ To install a specific version use:
pip install vyper==0.3.7

You can check if Vyper is installed completely or not by typing the following in your terminal/cmd:

::

vyper --version

nix
***

Expand Down
6 changes: 3 additions & 3 deletions docs/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Notable fixes:
- update tload/tstore opcodes per latest 1153 EIP spec (`#3484 <https://github.com/vyperlang/vyper/pull/3484>`_)
- fix: raw_call type when max_outsize=0 is set (`#3572 <https://github.com/vyperlang/vyper/pull/3572>`_)
- fix: implements check for indexed event arguments (`#3570 <https://github.com/vyperlang/vyper/pull/3570>`_)
- fix: type-checking for ``_abi_decode()`` arguments (`#3626 <https://github.com/vyperlang/vyper/pull/3623>`_)
- fix: type-checking for ``_abi_decode()`` arguments (`#3626 <https://github.com/vyperlang/vyper/pull/3623>`__)

Other docs updates, chores and fixes:
-------------------------------------
Expand Down Expand Up @@ -164,7 +164,7 @@ Other docs updates, chores and fixes:
- fix docs of ``blockhash`` to reflect revert behaviour (`#3168 <https://github.com/vyperlang/vyper/pull/3168>`_)
- improvements to compiler error messages (`#3121 <https://github.com/vyperlang/vyper/pull/3121>`_, `#3134 <https://github.com/vyperlang/vyper/pull/3134>`_, `#3312 <https://github.com/vyperlang/vyper/pull/3312>`_, `#3304 <https://github.com/vyperlang/vyper/pull/3304>`_, `#3240 <https://github.com/vyperlang/vyper/pull/3240>`_, `#3264 <https://github.com/vyperlang/vyper/pull/3264>`_, `#3343 <https://github.com/vyperlang/vyper/pull/3343>`_, `#3307 <https://github.com/vyperlang/vyper/pull/3307>`_, `#3313 <https://github.com/vyperlang/vyper/pull/3313>`_ and `#3215 <https://github.com/vyperlang/vyper/pull/3215>`_)

These are really just the highlights, as many other bugfixes, docs updates and refactoring (over 150 pull requests!) made it into this release! For the full list, please see the `changelog <https://github.com/vyperlang/vyper/compare/v0.3.7...v0.3.8>`_. Special thanks to contributions from @tserg, @trocher, @z80dev, @emc415 and @benber86 in this release!
These are really just the highlights, as many other bugfixes, docs updates and refactoring (over 150 pull requests!) made it into this release! For the full list, please see the `changelog <https://github.com/vyperlang/vyper/compare/v0.3.7...v0.3.8>`__. Special thanks to contributions from @tserg, @trocher, @z80dev, @emc415 and @benber86 in this release!

New Contributors:

Expand Down Expand Up @@ -346,7 +346,7 @@ Notable Fixes:
* Referencing immutables in constructor (`#2627 <https://github.com/vyperlang/vyper/pull/2627>`_)
* Arrays of interfaces in for loops (`#2699 <https://github.com/vyperlang/vyper/pull/2699>`_)

Lots of optimizations, refactoring and other fixes made it into this release! For the full list, please see the `changelog <https://github.com/vyperlang/vyper/compare/v0.3.1...v0.3.2>`_.
Lots of optimizations, refactoring and other fixes made it into this release! For the full list, please see the `changelog <https://github.com/vyperlang/vyper/compare/v0.3.1...v0.3.2>`__.

Special thanks to @tserg for typechecker fixes and significant testing of new features! Additional contributors to this release include @abdullathedruid, @hi-ogawa, @skellet0r, @fubuloubu, @onlymaresia, @SwapOperator, @hitsuzen-eth, @Sud0u53r, @davidhq.

Expand Down
8 changes: 4 additions & 4 deletions docs/testing-contracts-ethtester.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Prior to testing, the Vyper specific contract conversion and the blockchain rela

Since the testing is done in the pytest framework, you can make use of `pytest.ini, tox.ini and setup.cfg <https://docs.pytest.org/en/latest/customize.html>`_ and you can use most IDEs' pytest plugins.

.. literalinclude:: ../tests/base_conftest.py
.. literalinclude:: ../tests/conftest.py
:language: python
:linenos:

Expand All @@ -35,7 +35,7 @@ Assume the following simple contract ``storage.vy``. It has a single integer var

We create a test file ``test_storage.py`` where we write our tests in pytest style.

.. literalinclude:: ../tests/examples/storage/test_storage.py
.. literalinclude:: ../tests/functional/examples/storage/test_storage.py
:linenos:
:language: python

Expand All @@ -61,14 +61,14 @@ Next, we take a look at the two fixtures that will allow us to read the event lo

The fixture to assert failed transactions defaults to check for a ``TransactionFailed`` exception, but can be used to check for different exceptions too, as shown below. Also note that the chain gets reverted to the state before the failed transaction.

.. literalinclude:: ../tests/base_conftest.py
.. literalinclude:: ../tests/conftest.py
:language: python
:pyobject: get_logs

This fixture will return a tuple with all the logs for a certain event and transaction. The length of the tuple equals the number of events (of the specified type) logged and should be checked first.

Finally, we create a new file ``test_advanced_storage.py`` where we use the new fixtures to test failed transactions and events.

.. literalinclude:: ../tests/examples/storage/test_advanced_storage.py
.. literalinclude:: ../tests/functional/examples/storage/test_advanced_storage.py
:linenos:
:language: python
5 changes: 3 additions & 2 deletions docs/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ Syntax as follows: ``_address.<member>``, where ``_address`` is of the type ``ad
``_address.code`` requires the usage of :func:`slice <slice>` to explicitly extract a section of contract bytecode. If the extracted section exceeds the bounds of bytecode, this will throw. You can check the size of ``_address.code`` using ``_address.codesize``.

M-byte-wide Fixed Size Byte Array
----------------------
---------------------------------

**Keyword:** ``bytesM``
This is an M-byte-wide byte array that is otherwise similar to dynamically sized byte arrays. On an ABI level, it is annotated as bytesM (e.g., bytes32).
Expand Down Expand Up @@ -452,6 +452,7 @@ Note that ``in`` is not the same as strict equality (``==``). ``in`` checks that
The following code uses bitwise operations to add and revoke permissions from a given ``Roles`` object.

.. code-block:: python
@external
def add_user(a: Roles) -> Roles:
ret: Roles = a
Expand Down Expand Up @@ -676,4 +677,4 @@ All type conversions in Vyper must be made explicitly using the built-in ``conve
* Converting between bytes and int types which have different sizes follows the rule of going through the closest integer type, first. For instance, ``bytes1 -> int16`` is like ``bytes1 -> int8 -> int16`` (signextend, then widen). ``uint8 -> bytes20`` is like ``uint8 -> uint160 -> bytes20`` (rotate left 12 bytes).
* Enums can be converted to and from ``uint256`` only.

A small Python reference implementation is maintained as part of Vyper's test suite, it can be found `here <https://github.com/vyperlang/vyper/blob/c4c6afd07801a0cc0038cdd4007cc43860c54193/tests/parser/functions/test_convert.py#L318>`_. The motivation and more detailed discussion of the rules can be found `here <https://github.com/vyperlang/vyper/issues/2507>`_.
A small Python reference implementation is maintained as part of Vyper's test suite, it can be found `here <https://github.com/vyperlang/vyper/blob/c4c6afd07801a0cc0038cdd4007cc43860c54193/tests/parser/functions/test_convert.py#L318>`__. The motivation and more detailed discussion of the rules can be found `here <https://github.com/vyperlang/vyper/issues/2507>`__.
6 changes: 3 additions & 3 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx==5.0.0
recommonmark==0.6.0
sphinx_rtd_theme==0.5.2
sphinx==7.2.6
recommonmark==0.7.1
sphinx_rtd_theme==2.0.0

0 comments on commit 768b3e9

Please sign in to comment.