Updates PyPI deployment by CircleCI (see README_DEV.md for instructions)

Fix for #140
pull/137/merge
Dr. Sergey Pogodin 7 years ago
parent 2f98e962d3
commit 3d33e75299
  1. 3
      .circleci/config.yml
  2. 10
      README_DEV.md
  3. 23
      setup.py

@ -47,6 +47,9 @@ jobs:
steps: steps:
- checkout: - checkout:
path: /home/mythril path: /home/mythril
- run:
name: Verify Git tag vs. version
command: cd /home/mythril && python3 setup.py verify
- run: - run:
name: Build name: Build
command: cd /home/mythril && python3 setup.py sdist command: cd /home/mythril && python3 setup.py sdist

@ -1,6 +1,16 @@
For Developers For Developers
=============== ===============
## Deployment to PyPI
- Update `VERSION` constant on top of `setup.py` file to `vX.Y.Z`, where `X`,
`Y`, `Z` are some integers specifying the new version of the package;
- Create Git tag with the same version name `vX.Y.Z`;
- Push the tag to `Mythril` repo, CircleCI will take care about the rest
(testing, and deployment to PyPI if tests are successful).
In case of mismatch between Git tag and `VERSION` in `CircleCI` deployment will
be failed.
## Running tests ## Running tests
### python version ### python version

@ -1,6 +1,21 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
import os import os
# Package version (vX.Y.Z). It must match git tag being used for CircleCI
# deployment; otherwise the build will failed.
VERSION = "v0.16.7"
class VerifyVersionCommand(install):
"""Custom command to verify that the git tag matches our version"""
description = 'verify that the git tag matches our version'
def run(self):
tag = os.getenv('CIRCLE_TAG')
if (tag != VERSION):
info = "Git tag: {0} does not match the version of this app: {1}".format(tag, VERSION)
sys.exit(info)
long_description = ''' long_description = '''
Mythril is a security analysis tool for Ethereum smart contracts. It Mythril is a security analysis tool for Ethereum smart contracts. It
uses concolic analysis to detect various types of issues. Use it to uses concolic analysis to detect various types of issues. Use it to
@ -254,7 +269,7 @@ Credit
setup( setup(
name='mythril', name='mythril',
version=os.getenv('CIRCLE_TAG', 'v0.15.8')[1:], version=VERSION[1:],
description='Security analysis tool for Ethereum smart contracts', description='Security analysis tool for Ethereum smart contracts',
long_description=long_description, long_description=long_description,
@ -315,5 +330,9 @@ setup(
include_package_data=True, include_package_data=True,
scripts=['myth'] scripts=['myth'],
cmdclass = {
'verify': VerifyVersionCommand,
}
) )

Loading…
Cancel
Save