Skip to content

Commit

Permalink
Add twine in Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
fsquillace committed Jan 11, 2020
1 parent 23c9397 commit 44fcca3
Show file tree
Hide file tree
Showing 26 changed files with 309 additions and 67 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "src/pearllib/static/buava"]
path = src/pearllib/static/buava
url = https://github.com/fsquillace/buava
[submodule "integ-tests/test-utils"]
path = integ-tests/test-utils
[submodule "ci/test-utils"]
path = ci/test-utils
url = https://github.com/pearl-core/test-utils.git
22 changes: 17 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,55 @@ language: bash

sudo: required


jobs:
include:
- os: linux
env:
- PYTHON_VERSION="3.5"
- TRAVIS_BASH_VERSION="4.1" TRAVIS_ZSH_VERSION="5.0.0" TRAVIS_FISH_VERSION="2.2.0" TRAVIS_GIT_VERSION="1.8.5"
- secure: "mBCYzW67w+zzOCpwdeoLn+Z/FrE3B2LDYHa0ges7p5FFr8NaOjgZtNoOxKHWdyvnXyZXfb/fcBp6NvOZxcTGz1oCpnlpoWbfZRaSjlYav18pRJ6Wxu8YWsSo76be+/bkf4UufO1PUPxK33/h+jfioNARFwaBtbnBk7mo8O5VsIBZ/Xb/HZakN1btwLm5TakJ1MXrBPJR908H7qA/q895BbLucj7o5lhzMRl5mzhUoEyWWNgTI91+AybtAwHEWSWtymMzGbQeDegFNtt8G8aO6at5YgcJrlshmqDvWCCv+SxEQZWfltnpgmdw3Pbo0xGSVKndZtZ7Xgg1mn4F6J+CrrmtXaDlEmby96dHmWAB7L9Zgd1UgOMXa/FsOuIdnc2rHrkIxyvVPzJfucK66Yb5DGYb0GllDRJMqelvGMef0MFhmM2ra/RAz2/tY7Y7gCsM2VjxVZnKD+JbR/93xTIr5Cl6DbYxtnkwBHvbiT1aGO2ZLe73ifwtD6lN62mDJJBe8B8RbMotjS141We4VhuBC+qc2+o5whe3UvTo09LVYXbxeTv75N194XnhRJjirz+SIi6G6aZLjaPfrkCAwpsYtsIOMTamHVDMpp56noi3UlkBRgebYqKBT9sD2XKYLy7gP8Hji0e4ShVhHHw2YiUiOmQpNmoDZiByB30mEut2r6A="
- os: linux
env:
- PYTHON_VERSION="3.6"
- TRAVIS_BASH_VERSION="4.1" TRAVIS_ZSH_VERSION="5.0.0" TRAVIS_FISH_VERSION="2.2.0" TRAVIS_GIT_VERSION="1.8.5"
- secure: "mBCYzW67w+zzOCpwdeoLn+Z/FrE3B2LDYHa0ges7p5FFr8NaOjgZtNoOxKHWdyvnXyZXfb/fcBp6NvOZxcTGz1oCpnlpoWbfZRaSjlYav18pRJ6Wxu8YWsSo76be+/bkf4UufO1PUPxK33/h+jfioNARFwaBtbnBk7mo8O5VsIBZ/Xb/HZakN1btwLm5TakJ1MXrBPJR908H7qA/q895BbLucj7o5lhzMRl5mzhUoEyWWNgTI91+AybtAwHEWSWtymMzGbQeDegFNtt8G8aO6at5YgcJrlshmqDvWCCv+SxEQZWfltnpgmdw3Pbo0xGSVKndZtZ7Xgg1mn4F6J+CrrmtXaDlEmby96dHmWAB7L9Zgd1UgOMXa/FsOuIdnc2rHrkIxyvVPzJfucK66Yb5DGYb0GllDRJMqelvGMef0MFhmM2ra/RAz2/tY7Y7gCsM2VjxVZnKD+JbR/93xTIr5Cl6DbYxtnkwBHvbiT1aGO2ZLe73ifwtD6lN62mDJJBe8B8RbMotjS141We4VhuBC+qc2+o5whe3UvTo09LVYXbxeTv75N194XnhRJjirz+SIi6G6aZLjaPfrkCAwpsYtsIOMTamHVDMpp56noi3UlkBRgebYqKBT9sD2XKYLy7gP8Hji0e4ShVhHHw2YiUiOmQpNmoDZiByB30mEut2r6A="
- os: linux
env:
- PYTHON_VERSION="3.7"
- TRAVIS_BASH_VERSION="4.1" TRAVIS_ZSH_VERSION="5.0.0" TRAVIS_FISH_VERSION="2.2.0" TRAVIS_GIT_VERSION="1.8.5"
- secure: "mBCYzW67w+z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bxeTv75N194XnhRJjirz+SIi6G6aZLjaPfrkCAwpsYtsIOMTamHVDMpp56noi3UlkBRgebYqKBT9sD2XKYLy7gP8Hji0e4ShVhHHw2YiUiOmQpNmoDZiByB30mEut2r6A="
- os: osx
env:
- PYTHON_VERSION="3.6"
- TRAVIS_BASH_VERSION="4.1" TRAVIS_ZSH_VERSION="5.0.0" TRAVIS_FISH_VERSION="2.2.0" TRAVIS_GIT_VERSION="1.8.5"
- secure: "mBCYzW67w+zzOCpwdeoLn+Z/FrE3B2LDYHa0ges7p5FFr8NaOjgZtNoOxKHWdyvnXyZXfb/fcBp6NvOZxcTGz1oCpnlpoWbfZRaSjlYav18pRJ6Wxu8YWsSo76be+/bkf4UufO1PUPxK33/h+jfioNARFwaBtbnBk7mo8O5VsIBZ/Xb/HZakN1btwLm5TakJ1MXrBPJR908H7qA/q895BbLucj7o5lhzMRl5mzhUoEyWWNgTI91+AybtAwHEWSWtymMzGbQeDegFNtt8G8aO6at5YgcJrlshmqDvWCCv+SxEQZWfltnpgmdw3Pbo0xGSVKndZtZ7Xgg1mn4F6J+CrrmtXaDlEmby96dHmWAB7L9Zgd1UgOMXa/FsOuIdnc2rHrkIxyvVPzJfucK66Yb5DGYb0GllDRJMqelvGMef0MFhmM2ra/RAz2/tY7Y7gCsM2VjxVZnKD+JbR/93xTIr5Cl6DbYxtnkwBHvbiT1aGO2ZLe73ifwtD6lN62mDJJBe8B8RbMotjS141We4VhuBC+qc2+o5whe3UvTo09LVYXbxeTv75N194XnhRJjirz+SIi6G6aZLjaPfrkCAwpsYtsIOMTamHVDMpp56noi3UlkBRgebYqKBT9sD2XKYLy7gP8Hji0e4ShVhHHw2YiUiOmQpNmoDZiByB30mEut2r6A="
- os: osx
env:
- PYTHON_VERSION="3.7"
- TRAVIS_BASH_VERSION="4.1" TRAVIS_ZSH_VERSION="5.0.0" TRAVIS_FISH_VERSION="2.2.0" TRAVIS_GIT_VERSION="1.8.5"
- secure: "mBCYzW67w+zzOCpwdeo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Cv+SxEQZWfltnpgmdw3Pbo0xGSVKndZtZ7Xgg1mn4F6J+CrrmtXaDlEmby96dHmWAB7L9Zgd1UgOMXa/FsOuIdnc2rHrkIxyvVPzJfucK66Yb5DGYb0GllDRJMqelvGMef0MFhmM2ra/RAz2/tY7Y7gCsM2VjxVZnKD+JbR/93xTIr5Cl6DbYxtnkwBHvbiT1aGO2ZLe73ifwtD6lN62mDJJBe8B8RbMotjS141We4VhuBC+qc2+o5whe3UvTo09LVYXbxeTv75N194XnhRJjirz+SIi6G6aZLjaPfrkCAwpsYtsIOMTamHVDMpp56noi3UlkBRgebYqKBT9sD2XKYLy7gP8Hji0e4ShVhHHw2YiUiOmQpNmoDZiByB30mEut2r6A="

before_install:
- make install-conda
- PYTHON_VERSION=$PYTHON_VERSION make init-env-conda
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./integ-tests/test-utils/installs/install-linux-deps.sh; fi;
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./integ-tests/test-utils/installs/install-osx-deps.sh; fi;
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./ci/test-utils/installs/install-linux-deps.sh; fi;
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./ci/test-utils/installs/install-osx-deps.sh; fi;

install:
- make install
Expand All @@ -59,6 +68,9 @@ script:
- make lint
- make test
- pearl --help
- bash ./integ-tests/integ-tests.sh $PWD
- zsh ./integ-tests/integ-tests.sh $PWD
- fish ./integ-tests/integ-tests.fish $PWD
- bash ./ci/integ-tests.sh $PWD
- zsh ./ci/integ-tests.sh $PWD
- fish ./ci/integ-tests.fish $PWD

after_success:
- ./ci/deploy.sh
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Change Log #

## [2.0.0][v200] - 2020-01-02 ##
## [2.0.1][v201] - 2020-01-11 ##

* Manual intervention to switch to Pearl v2
* [Migration page](https://github.com/pearl-core/pearl/wiki/Migration-to-Pearl-version-2)
* Codebase re-written in Python
* Remove the `post_remove`
* `pearl.conf` is not a python script. This requires manual intervention. Take a look at the `pearl.conf.template` file in codebase
Expand Down Expand Up @@ -223,4 +225,4 @@
[v180]: https://github.com/pearl-core/pearl/releases/tag/1.8.0
[v181]: https://github.com/pearl-core/pearl/releases/tag/1.8.1
[v182]: https://github.com/pearl-core/pearl/releases/tag/1.8.2
[v200]: https://github.com/pearl-core/pearl/releases/tag/2.0.0
[v201]: https://github.com/pearl-core/pearl/releases/tag/2.0.1
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ You need to specify the Pearl code location.
For instance, to run locally the integration tests against Pearl
located in `$HOME/pearl` using `Bash`, `Zsh` and `Fish` shells:
```sh
# bash ./integ-tests/integ-tests.sh $HOME/pearl
# zsh ./integ-tests/integ-tests.sh $HOME/pearl
# fish ./integ-tests/integ-tests.fish $HOME/pearl
# bash ./ci/integ-tests.sh $HOME/pearl
# zsh ./ci/integ-tests.sh $HOME/pearl
# fish ./ci/integ-tests.fish $HOME/pearl
```

Generally, there is no need to run integration tests locally
Expand Down
25 changes: 16 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ CONDA_EXE = ~/miniconda3/condabin/conda
CONDA_ENV_DIR = $(shell cat ${HOME}/.conda/environments.txt | grep envs/pearl)
CONDA_ENV_BIN = $(CONDA_ENV_DIR)/bin/wrappers/conda

PYTHON = $(CONDA_ENV_BIN)/python
PYTEST = $(PYTHON) -m pytest
PIP = $(PYTHON) -m pip
FLAKE8 = $(PYTHON) -m flake8
COVERAGE = $(PYTHON) -m coverage
FLAKE8 = $(PYTHON) -m flake8
PIP = $(PYTHON) -m pip
PYTEST = $(PYTHON) -m pytest
PYTHON = $(CONDA_ENV_BIN)/python
TOX = $(PYTHON) -m tox
TWINE = $(PYTHON) -m twine

help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
Expand Down Expand Up @@ -67,7 +69,7 @@ test: ## run tests quickly with the default Python
$(PYTEST)

test-all: ## run tests on every Python version with tox
tox
$(TOX)

coverage: ## check code coverage quickly with the default Python
$(COVERAGE) run --source pearllib -m pytest
Expand All @@ -86,12 +88,17 @@ docs: ## generate Sphinx HTML documentation, including API docs
servedocs: docs ## compile the docs watching for changes
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .

TWINE_REPOSITORY ?= https://pypi.org/legacy/
release: dist ## package and upload a release
twine upload dist/*
$(TWINE) upload --repository-url $(TWINE_REPOSITORY) dist/*

release-ci: dist ## package and upload a release from CI
# @ will not show the command to avoid exposing the password
@$(TWINE) upload -p $(TWINE_PASSWORD) -u $(TWINE_USER) --repository-url $(TWINE_REPOSITORY) dist/*

dist: clean ## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
$(PYTHON) setup.py sdist
$(PYTHON) setup.py bdist_wheel
ls -l dist

clean-conda: ## removes conda
Expand All @@ -111,7 +118,7 @@ create-conda-wrappers: ## create wrapper executables to be accessible outside th

upgrade: ## upgrades all dependencies
$(PIP) install --upgrade -r requirements-dev.in
$(PIP) freeze >> requirements-dev.txt
$(PIP) freeze | grep -v pearl > requirements-dev.txt

install: clean ## install the package to the active Python's site-packages
$(PIP) install -e .[dev]
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.0.1
11 changes: 11 additions & 0 deletions ci/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -e
export TWINE_REPOSITORY="https://test.pypi.org/legacy/"
export TWINE_USER="fsquillace"

[[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$PYTHON_VERSION" == "3.5" ]] && [[ "$TRAVIS_BRANCH" == "master" ]] && make release-ci

export TWINE_REPOSITORY="https://pypi.org/legacy/"

[[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$PYTHON_VERSION" == "3.5" ]] && [[ "$TRAVIS_BRANCH" == "master" ]] && make release-ci
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions ci/test-utils/installs/install-bash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
set -ex

VERSION=$1

cd /tmp
wget http://ftp.gnu.org/gnu/bash/bash-$VERSION.tar.gz

tar -zxf bash-$VERSION.tar.gz
cd /tmp/bash-$VERSION*
./configure
make
sudo make install
9 changes: 9 additions & 0 deletions ci/test-utils/installs/install-fish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -ex

VERSION=$1

cd /tmp
wget https://github.com/fish-shell/fish-shell/releases/download/$VERSION/fish-$VERSION.tar.gz
tar -xzf fish-$VERSION.tar.gz
cd /tmp/fish-$VERSION && ./configure && make && sudo make install
17 changes: 17 additions & 0 deletions ci/test-utils/installs/install-git.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
set -ex

VERSION=$1

cd /tmp
wget https://github.com/git/git/archive/v$VERSION.tar.gz

tar -zxf v$VERSION.tar.gz
cd /tmp/git-$VERSION*
# Update NO_GETTEXT to fix the problem of missing libintl in OSX (http://stackoverflow.com/a/11370808/967489):
# CFLAGS and LDFLAGS needs to be updated in OSX (https://www.atlassian.com/git/tutorials/install-git/mac-os-x)
export NO_GETTEXT=1
make CFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" configure
./configure
make CFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" all
sudo make CFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" install
10 changes: 10 additions & 0 deletions ci/test-utils/installs/install-linux-deps-fast.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -ex

sudo apt-get -qq update
sudo apt-get install -y zsh bash git

BASE_NAME="$(dirname $0)"

"${BASE_NAME}"/install-fish.sh "$TRAVIS_FISH_VERSION"
12 changes: 12 additions & 0 deletions ci/test-utils/installs/install-linux-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -ex

# Gettext is required for installing git from source code
sudo apt-get install gettext

BASE_NAME="$(dirname $0)"

"${BASE_NAME}"/install-bash.sh "$TRAVIS_BASH_VERSION"
"${BASE_NAME}"/install-zsh.sh "$TRAVIS_ZSH_VERSION"
"${BASE_NAME}"/install-fish.sh "$TRAVIS_FISH_VERSION"
"${BASE_NAME}"/install-git.sh "$TRAVIS_GIT_VERSION"
12 changes: 12 additions & 0 deletions ci/test-utils/installs/install-osx-deps-fast.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

set -ex

brew update
brew install bash zsh grep gnu-sed
# Coreutils and git should be already installed on OSX 7.3+ images:
#brew install coreutils git

BASE_NAME="$(dirname $0)"

"${BASE_NAME}"/install-fish.sh "$TRAVIS_FISH_VERSION"
17 changes: 17 additions & 0 deletions ci/test-utils/installs/install-osx-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
set -ex
brew update
brew install grep gnu-sed
# Coreutils and git should be already installed on OSX 7.3+ images:
#brew install coreutils git
# Openssl is required for installing git from source code
# Findutils is required for `fonts` Pearl package
brew install openssl findutils

BASE_NAME="$(dirname $0)"

"${BASE_NAME}"/install-bash.sh "$TRAVIS_BASH_VERSION"
"${BASE_NAME}"/install-zsh.sh "$TRAVIS_ZSH_VERSION"
"${BASE_NAME}"/install-fish.sh "$TRAVIS_FISH_VERSION"
"${BASE_NAME}"/install-git.sh "$TRAVIS_GIT_VERSION"

14 changes: 14 additions & 0 deletions ci/test-utils/installs/install-zsh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
set -ex

VERSION=$1

cd /tmp
wget http://downloads.sourceforge.net/project/zsh/zsh/$VERSION/zsh-$VERSION.tar.gz

tar -zxf zsh-$VERSION.tar.gz
cd /tmp/zsh-$VERSION*
# The option --without-tcsetpgrp is required for OSX
./configure --without-tcsetpgrp
make
sudo make install
12 changes: 12 additions & 0 deletions ci/test-utils/integ-tests/default-integ-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh

hash -r
git --version
bash --version
zsh --version
fish --version
./tests/bunit/bin/checkstyle.sh ./bin/ ./lib/
./tests/bunit/bin/unit-tests.sh ./tests/unit-tests
bash ./tests/test-utils/integ-tests/integ-tests.sh
zsh ./tests/test-utils/integ-tests/integ-tests.sh
fish ./tests/test-utils/integ-tests/integ-tests.fish
27 changes: 27 additions & 0 deletions ci/test-utils/integ-tests/default-travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This is the Travis yml file template.
# Copy this to the Pearl package.
#
# vim: ft=yaml

os:
- linux
- osx

language: bash

sudo: required

env:
- TRAVIS_BASH_VERSION="4.1" TRAVIS_ZSH_VERSION="5.0.0" TRAVIS_FISH_VERSION="2.2.0" TRAVIS_GIT_VERSION="1.8.0"

before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./tests/test-utils/installs/install-linux-deps.sh; fi;
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./tests/test-utils/installs/install-osx-deps.sh; fi;

install:
- curl -sL https://git.io/vV4yE | sh
- source ~/.bashrc
- echo "PEARL_PACKAGES['test']='${PWD}'" >> ~/.config/pearl/pearl.conf

script:
- bash ./tests/test-utils/integ-tests/default-integ-tests.sh
23 changes: 23 additions & 0 deletions ci/test-utils/integ-tests/integ-tests.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env fish

source "$HOME/.config/fish/config.fish"

pearl install test

# Fish trap may not work from time to time.
# Forcing the sourcing here:
source "$HOME/.config/fish/config.fish"

if [ ! -d "$PEARL_HOME/packages/default/test" ]
echo 'Error: The package `test` does not exist after installing it.'
exit 1
end

# From here is where you can add the integ tests for your packages
source ./tests/integ-tests/integ-tests-common.sh

pearl update test

pearl remove test

# vim: ft=sh
26 changes: 26 additions & 0 deletions ci/test-utils/integ-tests/integ-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
set -e

[ -n "$BASH_VERSION" ] && source "$HOME/.bashrc"
[ -n "$ZSH_VERSION" ] && source "$HOME/.zshrc"

pearl install test

if [ ! -d "$PEARL_HOME/packages/default/test" ]; then
echo 'Error: The package `test` does not exist after installing it.'
exit 1
fi

# set -x option enabled by default as a reminder.
# Let the consumer decide whether to disable it or not.
set -x

# From here is where you can add the integ tests for your packages
source ./tests/integ-tests/integ-tests-common.sh

set +x

pearl update test

pearl remove test

# vim: ft=sh
Loading

0 comments on commit 44fcca3

Please sign in to comment.