vyper icon indicating copy to clipboard operation
vyper copied to clipboard

Add nightly build for Vyper

Open Saw-mon-and-Natalie opened this issue 2 years ago • 12 comments

Having nightly builds as part of GitHub workflows would allow integrating the new unreleased features with other tools. As an example, one can use the nightly builds with @nomiclabs/hardhat-vyper plugin.

Saw-mon-and-Natalie avatar Jun 16 '22 03:06 Saw-mon-and-Natalie

@Saw-mon-and-Natalie what is the best distribution channel for these? we already have continuous docker builds and wondering if that works for this use case - https://hub.docker.com/r/vyperlang/vyper. or do we need a continually updated, "nightly" github release?

charles-cooper avatar Jun 16 '22 05:06 charles-cooper

I think an additional GitHub nightly release would be nice. That might make it really easy for example with hardhat-vyper plugin to pull the nightly without changing any of the plug-in implementation.

Saw-mon-and-Natalie avatar Jun 16 '22 14:06 Saw-mon-and-Natalie

we could have a special release tagged "pre-release" which we automatically update every commit to master.

charles-cooper avatar Jun 16 '22 16:06 charles-cooper

we could have a special release tagged "pre-release" which we automatically update every commit to master.

i created https://github.com/vyperlang/vyper/releases/tag/pre-release, maybe we can auto-update it every commit to master

charles-cooper avatar Jun 17 '22 20:06 charles-cooper

I've created a GitHub workflow for the pre-release. Probably will make a PR for it tonight.

Saw-mon-and-Natalie avatar Jun 17 '22 20:06 Saw-mon-and-Natalie

i deleted the release because, unfortunately, it breaks brownie:

Screenshot from 2022-06-17 16-51-36

i did not test hardhat or ape, i'm curious how we can publish this pre-release version without affecting dev frameworks.

charles-cooper avatar Jun 17 '22 20:06 charles-cooper

We could also use a tag like x.y.z-pre-release where x.y.z is the next semver version (adding 1 to the patch version number).

Or following PEP 440, we could use X.YpreZ style pre-release tags.

Saw-mon-and-Natalie avatar Jun 17 '22 22:06 Saw-mon-and-Natalie

i did not test [...] ape, i'm curious how we can publish this pre-release version without affecting dev frameworks.

tbh in ape it works perfectly fine installing from any git branch via pypi

fubuloubu avatar Jun 18 '22 00:06 fubuloubu

The workflow in PR #2920 can aslo be customized futher to specifiy a custom tag_name. Based on my findings from the different version comparisons, we have:

  • hardhat-vyper plugin uses semver, so tags like 0.3.4-pre-release would work.
  • Brownie and Ape use semantic_version which would also allow a tag like 0.3.4-pre-release
  • Vyper's setup uses setuptools_scm which tries to implement PEP440 and does not allow for tags like 0.3.4-pre-release, but accepts tags like 0.3pre4. If we go by the 0.3.4-pre-release pattern, we can probably strip the end pre-release in _global_version(version) before feeding it to use_scm_version

Saw-mon-and-Natalie avatar Jun 19 '22 13:06 Saw-mon-and-Natalie

Added a new commit to #2920 to unify the pre-release tag format. Now the x.y.z-pre-release format should work across the board. Already tested the Vyper setup and hardhat-vyper plugin and they work.

We needed to modify the setup.py to make it work:

setup(
   ...
   use_scm_version={
   ...
      "tag_regex": r"^(?:[\w-]+-)?(?P<version>[vV]?\d+(?:\.\d+){0,2}[^-\+]*)(?:[-\+].*)?$"

By modifiying the DEFAULT_TAG_REGEX in setuptools_scm we make sure the ther version part doesn't pick up - character and the suffix after the version portion can start with either - or +.

Vyper contracts can have a pragma version tag like:

# @version 0.3.4-pre-release
a: uint256

and for hardhat projects, the hardhat.config.js file would look like this:

require("@nomiclabs/hardhat-vyper");

module.exports = {
  vyper: {
    version: "0.3.4-pre-release",
  },
};

Saw-mon-and-Natalie avatar Jun 20 '22 03:06 Saw-mon-and-Natalie

very cool! my one concern with this is that, pragmas like version >= 0.3.3 will accidentally get compiled with a pre-release version. does the pre-release suffix eliminate that possibility for all build tools?

charles-cooper avatar Jun 20 '22 04:06 charles-cooper

@charles-cooper , great point. I'll have to check that.

Saw-mon-and-Natalie avatar Jul 05 '22 12:07 Saw-mon-and-Natalie

we are now publishing builds to https://github.com/vyperlang/vyper-builds/, also all docker builds are available through GHCR as of https://github.com/vyperlang/vyper/pull/3435

charles-cooper avatar Jun 14 '23 21:06 charles-cooper