Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cebash/sakia
  • santiago/sakia
  • jonas/sakia
3 results
Show changes
Commits on Source (2471)
Showing with 1422 additions and 55 deletions
[Dolphin]
Timestamp=2014,2,16,12,25,25
Version=3
[Settings]
HiddenFilesShown=true
......@@ -38,4 +38,20 @@ nosetests.xml
.idea
# Generated files
src/cutecoin/gen_resources/*
src/sakia/gen_resources/*
src/icons_rc.py
src/i18n_rc.py
src/sakia/icons_rc.py
src/sakia/i18n_rc.py
res/i18n/qm
res/i18n/lang-*
out
.directory
temp
*_uic.py
# mypy
.mypy_cache
# pyenv
/.python-version
stages:
- format
- tests
- build
- release
image: registry.duniter.org/docker/python3/sakia-builder:1.2.0
# SUB-TASKS
.push_to_github:
tags:
- github
after_script:
# remove all files in current repo
- rm -rf ./*
- rm -rf .git*
# do a mirror clone in current repo
- git clone --mirror $CI_REPOSITORY_URL .
# do config for github push
- git remote add github $GITHUB_URL_AND_KEY
- git config --global user.email "contact@duniter.org"
- git config --global user.name "Duniter"
# remove refs about merge requests
- bash -c "cat packed-refs | grep -v 'refs/merge-requests' > packed-refs-new; echo 'Removed merge-requests refs.'"
- mv packed-refs-new packed-refs
# github push
- bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?"
.changes:
only:
changes:
- src/sakia/*
- .gitlab-ci.yml
- Makefile
- requirements_dev.txt
- requirements_deploy.txt
- requirements.txt
- setup.py
- tests/**/*.py
# TASKS
format:
extends:
- .changes
stage: format
script:
- pip install -r requirements_dev.txt
- make check-format
tests:
extends:
- .changes
stage: tests
script:
- pip install -r requirements.txt
- pip install -r requirements_dev.txt
- /start.sh # start xvfb
- make tests
build:
extends:
- .changes
stage: build
script:
- pip install -r requirements.txt
- pip install -r requirements_deploy.txt
- make build
release_appimage:
extends:
- .changes
stage: release
when: manual
script:
- pip install -r requirements.txt
- pip install -r requirements_deploy.txt
- make build
- make appimage
artifacts:
paths:
- ci/appimage/Sakia_x86_64.AppImage
# only:
# - master
release_pypi:
extends:
- .push_to_github
stage: release
when: manual
script:
- pip install -r requirements.txt
- pip install -r requirements_deploy.txt
- make build
- make deploy PYPI_LOGIN=${PYPI_LOGIN} PYPI_PASSWORD=${PYPI_PASSWORD}
only:
- master
release_pypi_test:
stage: release
when: manual
only: [tags, dev]
script:
- pip install -r requirements.txt
- pip install -r requirements_deploy.txt
- make build
- make deploy_test PYPI_TEST_LOGIN=${PYPI_TEST_LOGIN} PYPI_TEST_PASSWORD=${PYPI_TEST_PASSWORD}
requirements:
- requirements.txt
python-targets:
- 3
ignore-paths:
- lib
- build
- res
- ci
- doc
os: linux
matrix:
include:
- os: osx
- dist: trusty
sudo: required
exclude:
- os: linux
allow_failures:
- os: osx
env:
- PYENV_PYTHON_VERSION=3.5.4
before_install:
- ci/travis/before_install.sh
install:
- ci/travis/build.sh
script:
- ci/travis/test.sh
after_success:
- ci/travis/after_success.sh
- ci/travis/before_deploy.sh
deploy:
- provider: releases
api_key:
secure: MUdvTDBeCxO9d/EpzIhr+QYra/KxgYkXX6177SjqWCWDqw9xB3fwSUj8I9ht9DGtwVdadtveumtvLw3pbtVIR0GtIPC9pyvtNz4j6T4Ei3TSE6+StXdMK4NnInvPeTRlobGL+9sZt9MwheJwZ8YGewhBcR0F5UzVfxWeSSrxmyk=
file:
- sakia-${TRAVIS_OS_NAME}.zip
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_OS_NAME} = osx
- provider: releases
api_key:
secure: MUdvTDBeCxO9d/EpzIhr+QYra/KxgYkXX6177SjqWCWDqw9xB3fwSUj8I9ht9DGtwVdadtveumtvLw3pbtVIR0GtIPC9pyvtNz4j6T4Ei3TSE6+StXdMK4NnInvPeTRlobGL+9sZt9MwheJwZ8YGewhBcR0F5UzVfxWeSSrxmyk=
file:
- sakia-${TRAVIS_OS_NAME}.deb
- sakia-${TRAVIS_OS_NAME}.zip
- sakia-${TRAVIS_TAG}-py3-none-any.whl
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_OS_NAME} = linux
## v0.53.2 (18/01/2021)
This is the last version released by Vit.
No more new version or maintenance will be done.
Thanks to Inso for this wonderful project, and to every enthusiast users.
### Bugs
* #809 fix About Sakia available release search code and obsolete link to Github in exception
* #813 remove obsolete github references in README.md
* #815 remove unused dependency asynctest from requirements.txt
* fix "make tests" command running test scripts from AppDir in ci/appimage
## v0.53.1 (1/11/2020)
### Bugs
* #811 Fix WoT window is blank when clicking Explore until the menu "Show in WoT" is used.
Button is removed.
* #793 Fix crash `RuntimeError: no running event loop` when running on Python 3.8
### CI/CD
* #817 Add AppImage to release with automatic compilation in CD
## v0.53.0 (25/09/2020)
### Features
* #816 Add root_servers.yml in $HOME/.config/sakia folder to configure your own root servers
## v0.52.0 (23/04/2020)
### Features
* #807 Add new "Percentage of Average" referential
* Transfer window now use current referential instead of only relative by UD
* Add current referential units on the balance display
### Bugs
* Fix referentials french translation
* Fix network "Open in browser" menu
## v0.51.1 (05/04/2020)
### Bugs
* #802 Fix "Send as source" context menu not appear in Expert Mode on normal received transactions
* Update incomplete french translation
## v0.51.0 (03/04/2020)
### Features
* #798 - Complete workflow to send transaction that we can get back after one week:
* A selector allow to choose the lock condition of the output transaction
* Then, the transaction with special lock condition appears with an underline in the transaction history
* If you are the receiver, you can use the context menu action "Send as source" to send it to yourself
before the issuer get it back
* If you are the issuer, use the context menu action "Send as source" to send it to yourself after the delay
* Before the delay, you can check the lock condition in the transfer window to see the date when the transaction will be unlocked
* In Expert Mode (see Preferences), you can use any incoming transaction or dividend as source for your transfer
### Enhancement
* Add a legend for colors, italic and underlined display of transactions under transaction history
* Upgrade dependencies to duniterpy 0.57.0
### Bugs
* Fix gen_translations.py running Qt4 lrelease in Makefile
* Fix error parsing some WSP2 Head message because software version had a prefix (duniterpy fix)
### CI/CD
* Remove obsolete runner tag
* Release job only on `master`, release_test job only on `dev` or `tags`
## v0.50.5 (21/03/2020)
### Bugs
* Fix send money to pubkey with search user selected
### Tests
* Update and fix pytest suite
* Update duniter-mirage dependency version
### Enhancements
* Tx history update button set to disable until update is done
* Increase delay between network crawlings to 1 mn
### CI/CD
* Add format and tests stage in .gitlab-ci.yml
## v0.50.4 (18/03/2020)
### Code
* Fix session closed error (regression in v0.50.3)
## v0.50.3 (16/03/2020)
### Code
* Fix exception when refresh tx history
* Fix Unclosed client session error (at last !)
### CI/CD
* Fix bug with setuptools 28.8.x version in gitlab CI/CD image
## v0.50.2 (10/03/2020)
### Code
* Add system libs requirement and command line options in README.md
* Fix bad label "ok" on startup message box and enhance it
* Propose new sakia account menu at first start instead of create a new member account on the network
* Only display licence step when registering a new member account on the network
* Update french translation
### Project
* Fix release.sh using simple quote on sakia.__init__ version
* Add this changelog
## v0.50.1 (08/03/2020)
### Code
* Use asyncio.ensure_future() instead of async() which disappear from Py 3.7
* Include the license file into the wheel distributed, the license changed name
### CI/CD
* Fix sources path and allow all file extensions to trigger the CI
### Build
* Add dist check after build in Makefile
### Project
* Fix release.sh broken by black format
## [v0.50.0](https://git.duniter.org/clients/python/sakia/-/milestones/15) (07/03/2020)
### Code
* Update DuniterPy dependency to 0.56.0
* Fix all detected bugs
* Add the Sakia icon in toolbar
* Remove search direct connections
* Add update button in tx history
* Fix translation system
* Update french translation
This diff is collapsed.
.PHONY: docs tests check check-format mypy pylint format build deploy deploy_test
.SILENT: deploy deploy_test # do not echo commands with password
# bash required to use source command
SHELL := /bin/bash
# run tests
tests:
python3 gen_resources.py
python3 gen_translations.py
pytest -q -s --disable-warnings tests ${TESTS_FILTER}
# check
check: mypy pylint check-format
# check static typing
mypy:
python3 -m mypy src --ignore-missing-imports
python3 -m mypy tests --ignore-missing-imports
# check code errors
pylint:
pylint --disable=C,R0902,R0903,R0904,R0912,R0913,R0914,R0915,W0613 --enable=C0121,C0202,C0321 --jobs=0 src/sakia/
pylint --disable=C,R0902,R0903,R0904,R0912,R0913,R0914,R0915,W0613 --enable=C0121,C0202,C0321 --jobs=0 tests/
# check format
check-format:
black --check src
black --check tests
# format code
format:
black src
black tests
# build a wheel package in build folder and put it in dist folder
build:
if [ -d "./build" ]; then rm -r build/*; fi
if [ -d "./dist" ]; then rm -r dist/*; fi
python3 gen_resources.py
python3 gen_translations.py
python3 setup.py sdist bdist_wheel
twine check dist/*
appimage:
cd ci/appimage && wget -qc https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod u+x linuxdeploy-x86_64.AppImage
cd ci/appimage && wget -qc https://github.com/niess/linuxdeploy-plugin-python/releases/download/continuous/linuxdeploy-plugin-python-x86_64.AppImage && chmod u+x linuxdeploy-plugin-python-x86_64.AppImage
cd ci/appimage && source config.env && ./build.sh
# upload on PyPi repository
deploy:
twine upload dist/* --username ${PYPI_LOGIN} --password ${PYPI_PASSWORD}
# upload on PyPi test repository
deploy_test:
twine upload dist/* --username ${PYPI_TEST_LOGIN} --password ${PYPI_TEST_PASSWORD} --repository-url https://test.pypi.org/legacy/
cutecoin
========
![sakia logo](https://git.duniter.org/clients/python/sakia/-/raw/master/sakia.png)
Qt Client for [Ucoin](http://www.ucoin.io) project.
This project is not maintained anymore since 18/01/2021.
No more new version or maintenance will be done.
Vit thanks Inso for this wonderful project, and every enthusiast users.
## Goal features
* Ucoin account management via wallets and communities
* Multi-currency
* Multi-community
* Multi-wallets
* Contacts management
* User-friendly money transfer
* Community membership management
# Sakia
[![coverage report](https://git.duniter.org/clients/python/sakia/badges/gitlab/coverage.svg)](https://git.duniter.org/clients/python/sakia/commits/gitlab)
[![pipeline status](https://git.duniter.org/clients/python/sakia/badges/gitlab/pipeline.svg)](https://git.duniter.org/clients/python/sakia/commits/gitlab)
[![Build Status](https://travis-ci.org/duniter/sakia.svg?branch=travis)](https://travis-ci.org/duniter/sakia)
[![Build status](https://ci.appveyor.com/api/projects/status/pvl18xon8pvu2c8w/branch/dev?svg=true)](https://ci.appveyor.com/project/Insoleet/sakia-bee4m/branch/dev)
Python3 and PyQt5 Client for [duniter](http://www.duniter.org) project.
## Current state
### Done (master branch)
### Features
* Accounts management
* Communities viewing
* Money Transfer
* cx_freeze deployment
* Wallet management (no multiple wallets yet)
* Wallets management
* Contacts management
### Todo
* Joining a community, publishing keys
* Multiple wallets management
### How to install
* __git clone --recursive https://github.com/Insoleet/cutecoin.git__
* Note : On Windows, this can't be installed because of Pynacl not available on this OS. Issue #100 opened : https://github.com/pyca/pynacl/issues/100 )
* Install [python3](https://www.python.org/downloads/), [cx_freeze for python 3](http://cx-freeze.sourceforge.net/) and [pyqt5](http://www.riverbankcomputing.co.uk/software/pyqt/download5), and [pip](http://www.pip-installer.org/en/latest/)
* Run :
* __pip install scrypt__
* __pip install pynacl__
* __pip install requests__
* Run __python gen_resources.py__ in cutecoin folder
* Run __python setup.py build__ in cutecoin folder
* The executable is generated in "build" folder, named "__init__"
### Dependencies
* Dependencies :
* Qt5
* [python 3.6+](https://www.python.org/downloads/)
* [libsodium](http://doc.libsodium.org/installation/README.html)
General tips : use [pyenv](https://github.com/pyenv/pyenv) to build sakia, as described in the [documentation](https://git.duniter.org/clients/python/sakia/-/blob/master/doc/install_for_developers.md)
Building Python with pyenv requires libraries of `openssl` and `sqlite3`. On Ubuntu, install it using the following commands :
apt-get update
apt-get install libssl-dev
apt-get install libsqlite3-dev
### Install with pip
* Run `pip install sakia`
* start "sakia" :)
### Download latest release
* Go to [current release](https://git.duniter.org/clients/python/sakia/-/releases)
* Download AppImage for linux x86_64. Run it !
* Join our developer community by contacting us on [duniter forum](http://forum.duniter.org/)
## Command line options
`-d` to display log to debug
`--currency g1-test` to connect to the g1-test currency network.
## Development
* When writing docstrings, use the reStructuredText format recommended by [PEP 0287](https://www.python.org/dev/peps/pep-0287/#docstring-significant-features)
* Use make commands to check the code and the format it correct.
The development tools require Python 3.6.x or higher.
* Install a supported Python version with [pyenv](https://github.com/pyenv/pyenv)
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
* Create a virtualenv in the project folder:
python -m venv .venv
* Install dependencies
pip install -r requirements.txt
* Run Sakia from the source code
PYTHONPATH="`pwd`/src/." python src/sakia/main.py
* Before submiting a merge requests, please check the static typing and tests.
* Install dev dependencies
pip install -r requirements_dev.txt
* Check static typing with [mypy](http://mypy-lang.org/)
make check
* Run all unit tests (pytest module) with:
make tests
> **Warning:** *do not run tests with sakia installed in your dev environment, because pytest will use the installed Sakia.*
* Run only some unit tests by passing a special ENV variable:
make tests TESTS_FILTER=tests/functional/test_transfer_dialog.py::test_transfer
## Packaging and deploy
### PyPi
In the development pyenv environment, install the tools to build and deploy
pip install --upgrade -r requirements_deploy.txt
Change and commit and tag the new version number (semantic version number)
./release.sh 0.x.y
Build the PyPi package in the `dist` folder
make build
Deploy the package to PyPi test repository (prefix the command with a space in order for the shell not to save in its history system the command containing the password)
[SPACE]make deploy_test PYPI_TEST_LOGIN=xxxx PYPI_TEST_PASSWORD=xxxx
Install the package from PyPi test repository
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.python.org/simple/ sakia
Deploy the package on the PyPi repository (prefix the command with a space in order for the shell not to save in its history system the command containing the password)
[SPACE]make deploy PYPI_LOGIN=xxxx PYPI_PASSWORD=xxxx
### Wheel Build scripts
make build
Or manually:
* Install __wheel__ with `pip install wheel`
* Run `python3 gen_resources.py` in sakia folder
* Run `python3 gen_translations.py` in sakia folder
* To build the wheel : Run `python3 setup.py bdist_wheel` in sakia folder
### AppImage
make appimage
The make command will do a wheel build, then create the AppImage file `ci/appimage/Sakia_x86_64.AppImage`
### Pyinstaller Build scripts (not maintained)
* Install __pyinstaller__ with `pip install pyinstaller`
* Run `python3 gen_resources.py` in sakia folder
* Run `python3 gen_translations.py` in sakia folder
* To build the binaries : Run `pyinstall sakia.spec`
## License
This software is distributed under [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.html).
environment:
global:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci\\appveyor\\run_with_env.cmd"
matrix:
- PYTHON: "C:\\Python35_64"
PYTHON_VERSION: "3.5"
PYTHON_ARCH: "64"
CONDA_PY: "35"
CONDA_NPY: "18"
QTDIR: "C:\\Qt\\5.9\\msvc2015_64"
platform: x64
- PYTHON: "C:\\Python35_32"
PYTHON_VERSION: "3.5"
PYTHON_ARCH: "32"
CONDA_PY: "35"
CONDA_NPY: "18"
QTDIR: "C:\\Qt\\5.9\\msvc2015"
platform: x86
install:
# this installs the appropriate Miniconda (Py2/Py3, 32/64 bit),
# as well as pip, conda-build, and the binstar CLI
- powershell .\\ci\\appveyor\\install.ps1
#- dir /b /s /ad c:\Qt\5.6
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
#- "SET QT_PLUGIN_PATH=%QTDIR%\\plugins"
- echo %PATH%
#- choco install -y vcredist2015
- "%CMD_IN_ENV% conda config --set always_yes yes --set changeps1 no"
- "%CMD_IN_ENV% conda config --add channels inso/channel/sakia"
- "%CMD_IN_ENV% conda create -q -n test-environment python=%PYTHON_VERSION% libsodium=1.0.3 setuptools=19.2"
build_script:
- ".\\ci\\appveyor\\build.cmd"
#test_script:
- ".\\ci\\appveyor\\tests.cmd"
- echo %errorlevel%
- powershell .\\ci\\appveyor\\download_vcredist.ps1 -target %cd%\\ci\\appveyor
# Windows Installer
- choco install -y InnoSetup
- set PATH="C:\Program Files (x86)\Inno Setup 5";%PATH%
- iscc %cd%\ci\appveyor\sakia.iss /DROOT_PATH=%cd%
- move %cd%\sakia.exe %cd%\sakia-%APPVEYOR_REPO_TAG_NAME%-win%PYTHON_ARCH%.exe
artifacts:
- path: dist
name: sakia-win$(PYTHON_ARCH)
- path: sakia*.exe
name: sakia-exe
# upload to releases
deploy:
tag: $(APPVEYOR_REPO_TAG_NAME)
release: sakia $(APPVEYOR_REPO_TAG_NAME)
provider: GitHub
auth_token:
secure: wbzlh6nx1zY1J1avlB0C3hKGm1abFNHBdM60u/U09i5Nam//D6kazvnv5ZBKdR89
artifact: /sakia-/
draft: true
prerelease: true
on:
appveyor_repo_tag: true
#!/bin/bash
#./linuxdeploy-x86_64.AppImage --appdir AppDir -i sakia.png -d sakia.desktop --plugin python --output appimage --custom-apprun sakia.sh
# workaround to run inside a docker container
./linuxdeploy-x86_64.AppImage --appimage-extract
mv squashfs-root linuxdeploy-x86_64.AppDir
./linuxdeploy-x86_64.AppDir/AppRun --appdir AppDir -i sakia.png -d sakia.desktop --plugin python --output appimage --custom-apprun sakia.sh
version=0.53.2
# linuxdeploy python plugin
export PYTHON_SOURCE=https://www.python.org/ftp/python/3.6.10/Python-3.6.10.tgz
export PIP_REQUIREMENTS=$(pwd)/../../dist/sakia-${version}-py3-none-any.whl
# linuxdeploy appimage plugin
export OUTPUT=Sakia_x86_64.AppImage
[Desktop Entry]
Version=1.0
Name=Sakia
Name[fr]=Sakia
Comment=Duniter Ğ1 Libre Currency Client
Comment[fr]=Client pour la Monnaie Libre Duniter Ğ1
GenericName=Sakia client
GenericName[fr]=Client Sakia
Exec=sakia
Terminal=false
Type=Application
Icon=sakia
Categories=Utility;
StartupNotify=true
GenericName[fr_FR]=Client Sakia
Comment[fr_FR]=Client pour la Monnaie Libre Duniter Ğ1
MimeType=x-scheme-handler/duniter;
ci/appimage/sakia.png

51.5 KiB

#!/bin/bash
# Export APPRUN if running from an extracted image
self="$(readlink -f -- $0)"
here="${self%/*}"
APPDIR="${APPDIR:-${here}}"
# Call the entry point
${APPDIR}/usr/bin/python3.6 -s ${APPDIR}/usr/python/lib/python3.6/site-packages/sakia/main.py "$@"
@ECHO OFF
rd /s /q %APPDATA%\sakia
\ No newline at end of file
@ECHO ON
call activate test-environment
echo "%PATH%"
echo "%QT_PLUGIN_PATH%"
python -V
lrelease -version
call pyuic5 --version
pyrcc5 -version
pip install -r requirements.txt
pip install pyinstaller==3.2
pip install six
pip install packaging
python gen_resources.py
if %errorlevel% neq 0 exit /b 1s
call .\\ci\\appveyor\\gen_translations.cmd
if %errorlevel% neq 0 exit /b 1
SET PATH=c:\\python35_64\\envs\\test-environment\\lib\\site-packages\\PyQt5\\Qt\\bin;%PATH%
pyinstaller sakia.spec
if %errorlevel% neq 0 exit /b 1
Param([String]$target)
Write-Host "Downloading vcredist to $target"
(New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/A/4/D/A4D9F1D3-6449-49EB-9A6E-902F61D8D14B/vcredist_x86.exe', "$target\vcredist_x86.exe")
(New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/A/4/D/A4D9F1D3-6449-49EB-9A6E-902F61D8D14B/vcredist_x64.exe', "$target\vcredist_x64.exe")
@ECHO ON
SET PREVPATH=%PATH%
SET PATH=%QTDIR%\\bin;%QTDIR%\\lib;%PATH%
lrelease -version
python gen_translations.py
if %errorlevel% neq 0 exit /b 1
SET PATH=%PREVPATH%
# Sample script to install Miniconda under Windows
# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner, Robert McGibbon
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
$MINICONDA_URL = "http://repo.continuum.io/miniconda/"
function DownloadMiniconda ($python_version, $platform_suffix) {
$webclient = New-Object System.Net.WebClient
if ($python_version -match "3.4") {
$filename = "Miniconda3-3.5.5-Windows-" + $platform_suffix + ".exe"
} else {
$filename = "Miniconda-3.5.5-Windows-" + $platform_suffix + ".exe"
}
$url = $MINICONDA_URL + $filename
$basedir = $pwd.Path + "\"
$filepath = $basedir + $filename
if (Test-Path $filename) {
Write-Host "Reusing" $filepath
return $filepath
}
# Download and retry up to 3 times in case of network transient errors.
Write-Host "Downloading" $filename "from" $url
$retry_attempts = 2
for($i=0; $i -lt $retry_attempts; $i++){
try {
$webclient.DownloadFile($url, $filepath)
break
}
Catch [Exception]{
Start-Sleep 1
}
}
if (Test-Path $filepath) {
Write-Host "File saved at" $filepath
} else {
# Retry once to get the error message if any at the last try
$webclient.DownloadFile($url, $filepath)
}
return $filepath
}
function InstallMiniconda ($python_version, $architecture, $python_home) {
Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home
if (Test-Path $python_home) {
Write-Host $python_home "already exists, skipping."
return $false
}
if ($architecture -match "32") {
$platform_suffix = "x86"
} else {
$platform_suffix = "x86_64"
}
$filepath = DownloadMiniconda $python_version $platform_suffix
Write-Host "Installing" $filepath "to" $python_home
$install_log = $python_home + ".log"
$args = "/S /D=$python_home"
Write-Host $filepath $args
Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru
if (Test-Path $python_home) {
Write-Host "Python $python_version ($architecture) installation complete"
} else {
Write-Host "Failed to install Python in $python_home"
Get-Content -Path $install_log
Exit 1
}
}
function InstallCondaPackages ($python_home, $spec) {
$conda_path = $python_home + "\Scripts\conda.exe"
$args = "install --yes " + $spec
Write-Host ("conda " + $args)
Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru
}
function UpdateConda ($python_home) {
$conda_path = $python_home + "\Scripts\conda.exe"
Write-Host "Updating conda..."
$args = "update --yes conda"
Write-Host $conda_path $args
Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru
}
function main () {
InstallMiniconda $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON
UpdateConda $env:PYTHON
InstallCondaPackages $env:PYTHON "conda-build=1.4.0 pip jinja2 binstar"
}
main