Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions .github/workflows/pullrequest-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,22 @@ name: Test xxh on pull request
on: pull_request

jobs:
deploy:
test-full:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install xonsh
run: pip install xonsh
- name: Install xxh-dev
run: |
cd ..
git clone --depth 1 https://github.com/xxh/xxh-dev
cd xxh-dev
pip install -r requirements.txt
- name: Install xde
run: cd xde && pip install -r requirements.txt
- name: xde build
run: cd ../xxh-dev && ./xde build
run: cd xde && ./xde build
- name: xde up
run: cd ../xxh-dev && ./xde up
run: cd xde && ./xde up
- name: xde test
run: cd ../xxh-dev && ./xde test --not-interactive
run: cd xde && ./xde test --not-interactive



2 changes: 1 addition & 1 deletion .github/workflows/push-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Test xxh on push
on: push

jobs:
deploy:
test-short:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/release-build-appimage.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/release-build-portable.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/release-python-publish.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release

on:
release:
types: [created]

jobs:
build-appimage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install xonsh shell
run: pip install xonsh
- name: Build xxh-appimage
run: xonsh xxh-appimage-build.xsh
- name: Test
run: ls -lah build/xxh-x86_64.AppImage
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
build/xxh-x86_64.AppImage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-portable:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install xonsh shell
run: pip install xonsh
- name: Build xxh-portable-musl-alpine-build
run: xonsh xxh-portable-musl-alpine-build.xsh
- name: Test
run: ls -lah build/xxh-portable-musl-alpine-Linux-x86_64.tar.gz
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
build/xxh-portable-musl-alpine-Linux-x86_64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-python-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ platforms that could be forked and stuffed.
- [New questions](https://github.com/xxh/xxh/wiki#new-questions)

## Development
In the [xxh-dev](https://github.com/xxh/xxh-dev) repo there is full [dockerised](https://www.docker.com/) environment
In the [xxh development environment](https://github.com/xxh/xxh/tree/master/xde) repo there is full [dockerised](https://www.docker.com/) environment
for development, testing and contribution. The process of testing and development is orchestrated by `xde` tool and is as
easy as possible.

Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import setuptools
from xxh_xxh import __version__
from xxh.xxh_xxh import __version__

with open("README.md", "r", encoding="utf8") as fh:
long_description = fh.read()
Expand All @@ -22,9 +22,10 @@
'pyyaml'
],
platforms='Unix-like',
scripts=['xxh', 'xxh_xxh/xxh.zsh', 'xxh_xxh/xxh.xsh', 'xxh_xxh/xxh.bash'],
scripts=['xxh/xxh', 'xxh/xxh_xxh/xxh.zsh', 'xxh/xxh_xxh/xxh.xsh', 'xxh/xxh_xxh/xxh.bash'],
package_data={'xxh_xxh': ['*.py', '*.xxhc', 'xxh.*']},
packages=setuptools.find_packages(),
packages=['xxh_xxh'],
package_dir={'xxh_xxh': 'xxh/xxh_xxh'},
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Unix Shell",
Expand Down
3 changes: 3 additions & 0 deletions xde/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.xsh text linguist-language=Python
xde text linguist-language=Python
xde-test-fast text linguist-language=Python
31 changes: 31 additions & 0 deletions xde/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
xxh
squashfs-root
appimage
xxh-shell*
xxh-plugin*
*.pyc
*.out
*.xcf
*.egg
.eggs/
.pytest_cache/
build/
dist/
xxh_xxh.egg-info/
venv/

# temporary files from vim and emacs
*~
*#
.#*
*.swp
*.swo

# Editor project files
*.komodo*
.cache
.idea
.vscode/

# Mac
.DS_Store
25 changes: 25 additions & 0 deletions xde/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BSD 2-Clause License

Copyright (c) 2020, xxh
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
96 changes: 96 additions & 0 deletions xde/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Xxh Development Environment (xde)

Development and test environment for [xxh/xxh](https://github.com/xxh/xxh) contains
network of docker containers which allow to test the ssh connections and xxh functionality
with or without [FUSE](https://github.com/AppImage/AppImageKit/wiki/FUSE).

Docker containers in the network:

| Hostname | Auth | FUSE | rsync | users |
|-----------|------------------|------|-------|----------------------------------|
| start | `./xde g start` | | | `root`, `uxonsh`, `uzsh`, `ufish`, `ubash` |
| ubuntu_k | key | | | `root` |
| ubuntu_kf | key | yes | yes | `root` |
| centos_k | key | | | `root` |
| arch_p | password | | | `root`, `docker` |

Every container has `/xxh` it is the volume. For example if you'll add a file to `tests/new.xsh`
it appears on all hosts immediately in `/xxh/xde/tests/new.xsh`.

## Workflow

This workflow was originally developed on `ubuntu 20.04`, `docker 19.03.5`, `docker-compose 1.25.3`, `xonsh 0.9.14`, `pycharm 2019.3.3`.

0. Install packages:
```bash
apt install -y docker git # Or install docker from official repo - https://docs.docker.com/engine/install/ubuntu/
pip install -r requirements.txt
```

1. Create directory for xxh development:
```bash
mkdir -p ~/git && cd ~/git
git clone https://github.com/xxh/xxh
cd xxh/xde
./xde build # build docker containers
./xde up # run docker containers
./xde test # run tests first time
```

2. Open `~/git/xxh` in your IDE to make changes and commit many repos.
3. Now you can go to `start` host and try your first connect using xxh:
```shell script
./xde goto start

# Press UP key to get connection strings to other hosts from bash history.
# Here xxh will be from /xxh/xxh/ that is your local directory
#root@start>
xxh -i ~/id_rsa root@ubuntu_k

#root@start> #Try from another shell:
su uzsh
#uzsh@start>
xxh +I xxh-plugin-zsh-ohmyzsh
#uzsh@start>
xxh -i ~/id_rsa root@ubuntu_k
#root@ubuntu_k%
echo $ZSH_THEME && exit
#agnoster
#uzsh@start>
source xxh.zsh -i ~/id_rsa root@ubuntu_k
#root@ubuntu_k%
echo $ZSH_THEME
#bira
```

4. Change the code in IDE and run `xxh` on `start` container. It's so easy!
5. Run tests `./xde t` (don't forget about `./xde t --help` and fast mode `./xde t -sr`)
6. After end of work you can `./xde stop` or `./xde remove` the containers.
7. You rock! Try to find easter egg in the xxh code now.

## xxh development environment tool

```shell script
./xde -h
#usage: xde <command>
#
#xxh development environment commands:
#
# clone Git clone repos from https://github.com/xxh
# build Build the docker containers and get the xxh code if ./xxh is not exists
# up Docker-compose up the containers
# test t Run tests
# goto g Open bash by the container name part
# start Docker-compose start the containers
# stop Docker-compose stop the containers
# remove Docker-compose remove the containers
#
#Try `./xde <command> --help` to get more info.
#
#positional arguments:
# command Command to run
#
#optional arguments:
# -h, --help show this help message and exit

```
Loading