Skip to content

Commit

Permalink
Mergin from master
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeecardona committed Sep 24, 2021
2 parents 934fca4 + 002ba9f commit 6848181
Show file tree
Hide file tree
Showing 66 changed files with 2,357 additions and 1,937 deletions.
11 changes: 11 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version = 1

test_patterns = ["**/tests/**"]

[[analyzers]]
name = "python"
enabled = true

[analyzers.meta]
runtime_version = "3.x.x"
max_line_length = 100
54 changes: 35 additions & 19 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,33 +1,49 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# https://editorconfig.org
root = true

[*]
end_of_line = lf
insert_final_newline = true
[*.py]
indent_style = space
indent_size = 4
tab_width = 4
charset = utf-8
trim_trailing_whitespace = true
max_line_length = 100

[*.rst]
tab_width = 4
[*.{md,rst,txt,md.j2,rst.j2}]
indent_style = space
indent_size = 2

[*.yml]
tab_width = 2
[*.{ini,toml}]
indent_style = space
indent_size = 4

[*Dockerfile]
indent_style = space
indent_size = 4

[*.yaml]
tab_width = 2
[*.js]
indent_style = space
indent_size = 2

[*.xml]
tab_width = 2
[*.{html,css,html.j2,css.j2}]
indent_style = space
indent_size = 2

[*.glade]
tab_width = 2
[*.{yml,yaml,yaml.j2,yml.j2}]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
indent_size = 4

# The JSON files contain newlines inconsistently
[*.json]
insert_final_newline = ignore
indent_style = space
indent_size = 2

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ ignore =
W503, # line break before binary operator
E231, # missing whitespace after ','
max-line-length = 100
exclude = env
exclude = env,.direnv,docs
max-complexity = 25
111 changes: 71 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,74 @@ jobs:
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Checkout the current branch
run: |
echo "BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)" >> $GITHUB_ENV
git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
git fetch --unshallow --tags
git tag
if [[ $(git rev-parse --abbrev-ref HEAD) == "master" ]]; then
echo "reattaching HEAD on master"
git symbolic-ref --short HEAD || git checkout -b ${GITHUB_ENV}-test $GITHUB_ENV
fi
sudo apt update -q
yes | sudo ./scripts/bootstrap-dev-debian.sh
./scripts/bootstrap-dev-pip.sh system
#sudo apt install --no-install-recommends -y xvfb gir1.2-gtk-3.0 python3-gi python3-gi-cairo gir1.2-wnck-3.0 gobject-introspection libgirepository1.0-dev
export DISPLAY=:99.0
- name: Test with pytest
run: |
set -e
mkdir test-rtd
virtualenv test-rtd
. ./test-rtd/bin/activate
pip install -r requirements-dev.txt
rm -rf test-rtd
# for dev
make dev-actions
pipenv run pip install pycairo pygobject
# check
make check
make build
make test-actions
# prepare for deployment
make generate-paths
- uses: actions/checkout@v2

- name: Get tag
id: tag
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Checkout the current branch
run: |
echo "BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)" >> $GITHUB_ENV
git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
git fetch --unshallow --tags
git tag
if [[ $(git rev-parse --abbrev-ref HEAD) == "master" ]]; then
echo "reattaching HEAD on master"
git symbolic-ref --short HEAD || git checkout -b ${GITHUB_ENV}-test $GITHUB_ENV
fi
sudo apt update -q
yes | sudo ./scripts/bootstrap-dev-debian.sh
./scripts/bootstrap-dev-pip.sh system
#sudo apt install --no-install-recommends -y xvfb gir1.2-gtk-3.0 python3-gi python3-gi-cairo gir1.2-wnck-3.0 gobject-introspection libgirepository1.0-dev
export DISPLAY=:99.0
- name: Test with pytest
run: |
set -e
mkdir test-rtd
virtualenv test-rtd
. ./test-rtd/bin/activate
pip install -r requirements-dev.txt
rm -rf test-rtd
# for dev
make dev-actions
pipenv run pip install pycairo pygobject
# check
make check
make build
make test-actions
# prepare for deployment
make generate-paths
- name: Stores dists (Python 3.8)
uses: actions/upload-artifact@v2
if: "${{ matrix.python-version }} == 3.8"
with:
name: dists
path: dist/*

release-test:
runs-on: ubuntu-latest
needs:
- build
if: github.ref == 'refs/heads/master'
steps:
- name: Retrieve dists
uses: actions/download-artifact@v2
with:
name: dists
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
verify_metadata: false
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# .github/workflows/release.yml

name: Release


on:
push:
tags:
- '**'


jobs:
release:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Get tag
id: tag
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/}

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Checkout the current branch
run: |
echo "BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)" >> $GITHUB_ENV
git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
git fetch --unshallow --tags
git tag
if [[ $(git rev-parse --abbrev-ref HEAD) == "master" ]]; then
echo "reattaching HEAD on master"
git symbolic-ref --short HEAD || git checkout -b ${GITHUB_ENV}-test $GITHUB_ENV
fi
sudo apt update -q
yes | sudo ./scripts/bootstrap-dev-debian.sh
./scripts/bootstrap-dev-pip.sh system
#sudo apt install --no-install-recommends -y xvfb gir1.2-gtk-3.0 python3-gi python3-gi-cairo gir1.2-wnck-3.0 gobject-introspection libgirepository1.0-dev
export DISPLAY=:99.0
- name: Test with pytest
run: |
set -e
mkdir test-rtd
virtualenv test-rtd
. ./test-rtd/bin/activate
pip install -r requirements-dev.txt
rm -rf test-rtd
# for dev
make dev-actions
pipenv run pip install pycairo pygobject
# check
make build
# prepare for deployment
make generate-paths
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
verify_metadata: false
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

# - name: Publish distribution 📦 to PyPI
# if: startsWith(github.ref, 'refs/tags')
# uses: pypa/gh-action-pypi-publish@master
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ docs/_build/
AUTHORS
ChangeLog

.direnv
.envrc
.venv
.vscode/

Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ install-guake:
@echo "Please prefer you application package manager (apt, yum, ...)"
@echo
@echo "#############################################################"
@$(PYTHON_INTERPRETER) -m pip install -r requirements.txt
@if [ "$(DESTDIR)" = "" ]; then $(PYTHON_INTERPRETER) -m pip install -r requirements.txt; fi

@rm -f guake/paths.py.dev
@if [ -f guake/paths.py ]; then mv guake/paths.py guake/paths.py.dev; fi
Expand Down Expand Up @@ -144,7 +144,6 @@ install-schemas:
compile-shemas:
if [ $(COMPILE_SCHEMA) = 1 ]; then glib-compile-schemas $(DESTDIR)$(gsettingsschemadir); fi


uninstall-system: uninstall-schemas uninstall-locale
$(SHELL) -c $(PYTHON_SITEDIRS_FOR_PREFIX) \
| while read sitedir; do \
Expand Down Expand Up @@ -192,7 +191,7 @@ black-check:
PIPENV_IGNORE_VIRTUALENVS=1 pipenv run black --check $(MODULE)

flake8:
PIPENV_IGNORE_VIRTUALENVS=1 pipenv run python setup.py flake8
PIPENV_IGNORE_VIRTUALENVS=1 pipenv run flake8 guake

pylint:
PIPENV_IGNORE_VIRTUALENVS=1 pipenv run pylint --rcfile=.pylintrc --output-format=colorized $(MODULE)
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pyfakefs = "*"
pytest-cov = "*"
pew = "*"
black = "==21.8b0"
dephell = "*"
flakehell = "*"
toml = "*"
dataclasses = "*"
pyyaml = "*"
Expand Down
Loading

0 comments on commit 6848181

Please sign in to comment.