Open arjunaskykok opened 4 years ago
Is it okay to use third party package (python-semver) to implement this feature?
Yeah, I think the semver
package has no external dependencies, so it's safe to use
Use this package for npm semver compatibility: https://github.com/rbarrois/python-semanticversion
Note: Move to contract-level natspec
Note: Mostly fixed in https://github.com/vyperlang/vyper/pull/1995
Still need to discuss move to contract-level natpsec for easier parsing and sharing
Simple Summary
Currently we can add pragma in Vyper file, for example:
# @version 0.1.0b13
It means Vyper compiler version 0.2.0 will fail to compile this Vyper file. But this is too primitive. We need to add semver capability. It needs to support >=, ^, <, ==, for example:
# @version ==0.1.0b13
This pragma line means only Vyper compiler version 0.1.0b13 can compile this Vyper file successfully.
Motivation
Solidity pragma supports semver capability.
Specification
Semver specification is here: https://docs.npmjs.com/misc/semver
Backwards Compatibility
It's safe.
Dependencies
References
https://github.com/python-semver/python-semver https://vyper.readthedocs.io/en/latest/structure-of-a-contract.html https://solidity.readthedocs.io/en/v0.6.8/layout-of-source-files.html
Copyright
Copyright and related rights waived via CC0