tokenika / eosfactory

Python-based EOS smart-contract development & testing framework
http://eosfactory.io/
Other
243 stars 62 forks source link

Adjustments to enable ability to install eosfactory via pip/easy_install #85

Closed noisy closed 5 years ago

noisy commented 5 years ago

Thanks to this pull requests, it possible to upload eosfactory package to https://pypi.org/.

Thanks to that instalation of eosfactory is simple as: pip install eosfactory

Certain directories and files needed to be moved to eosfactory/ directory, otherwise it was impossible to add to egg package non-python files, even with manifest.

Settings of travis has been updated, so now Travis to be able to run tests first install eosfactory package, which during tests was build and uploaded to Test PyPi: https://test.pypi.org/project/eosfactory/#history (with version of Travis build).

Important: Travis will not build automatically release packages, and it is not advised to configure it in such a way (although it is possible). It is very important to know, that after package with version 1.2 will be uploaded, and manually deleted because of any reason... it it impossible to upload new build with the same number. In such cases, it is advisable to increase version number, for example to 1.2.1.

How to build and upload package to https://pypi.org/manage/project/eosfactory/releases/

  1. Remove dist and build directories, by: rm -rf ./dist/ ./build/ (potential artifacts after previous builds)
  2. Make sure that version of package in setup.py is correct
  3. Run python3 setup.py sdist bdist_wheel to build package
  4. Run twine upload dist/* to upload package 4.1.. You can upload to test pypi, by `twine upload --repository-url https://test.pypi.org/legacy/ dist/*
  5. To avoid typing user/password, put it into config ~/.pypirc

https://pypi.org/manage/project/eosfactory/releases/

Example of ~/.pypirc
[distutils]
index-servers=
    testpypi
    pypi

[testpypi]
repository = https://testpypi.python.org/pypi
username = tokenika
password = 

[pypi]
username = tokenika
password = 
noisy commented 5 years ago

As far as I understand, the proposed changes to the build system cause that every PR is built as a package which is then pushed to pypi repository.

The idea was to push this to test.pypi

https://github.com/tokenika/eosfactory/pull/85/files#diff-354f30a63fb0907d4ad57269548329e3R10

Also, this could be restricted by travis settings, to execute this only when code is merged to dev

stefanzarembinski commented 5 years ago

PYPI distributable EOSFactory is developed in the branch 'pypi-ready', now.