Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various Fixes for Gnome Extension #4391

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7544f82
added `GDK_DEBUG: portals` in environment
soumyaDghosh Oct 4, 2023
90c96ab
added layout for webkit2gtk-4.1 and changed all `SNAPCRAFT`s to `CRAFT`
soumyaDghosh Oct 4, 2023
99706fe
fixed typo
soumyaDghosh Oct 4, 2023
aaeb5b4
remove `GDK_DEBUG: portals` as unrelated and harmful
soumyaDghosh Oct 5, 2023
03407f2
fix: add part in snapcraft.yaml to build libgit2
sergiusens Oct 4, 2023
6c358a4
chore(remote-build): migrate LaunchpadClient and WorkTree (#4390)
mr-cal Oct 6, 2023
9bcc0c7
ci: disable python 3.8 testing
sergiusens Oct 6, 2023
cc25806
fix(remote-build): warn instead of error when using unsupported bases
sergiusens Oct 6, 2023
866c428
feat(remote-build): new command logic (#4395)
mr-cal Oct 6, 2023
8f8b866
chore: ignore types for pkg_resources (#4406)
mr-cal Oct 18, 2023
5165183
chore(deps): update craft-providers to 1.18.0 (#4409)
mr-cal Oct 19, 2023
6004639
feat(plugins): add core20 support for pyproject.toml projects (#4087)
brlin-tw Oct 19, 2023
93042a3
build(deps): bump urllib3 from 1.26.17 to 1.26.18 in /docs/.sphinx (#…
dependabot[bot] Oct 19, 2023
d0e3cf1
build(deps): bump urllib3 from 1.26.17 to 1.26.18 (#4404)
dependabot[bot] Oct 19, 2023
ba6ea95
chore: update Python version metadata (#4415)
lengau Oct 23, 2023
0548f4d
style: fix ruff format tox environment (#4416)
lengau Oct 23, 2023
9ec27cf
chore(deps): update ruff to 0.1.1 and fix lint issues (#4417)
lengau Oct 25, 2023
cd96dcd
chore(pyproject): quote versions (#4423)
mr-cal Oct 27, 2023
ed42603
fix(remote-build): parse `--launchpad-timeout` argument (#4426)
mr-cal Oct 28, 2023
facbcc6
chore: migrate dev environment to ubuntu 22.04 and python 3.10 (#4425)
mr-cal Oct 30, 2023
7d3c35a
docs(TESTING.md): update commands (#4428)
stephensp Oct 30, 2023
e3865d3
build(deps): bump craft-providers to 1.19.1 (#4421) (#4429)
syu-w Oct 31, 2023
71f3b05
fix(cli): catch remote-build errors
mr-cal Oct 27, 2023
1ffda79
fix(remote-build): improve logging
mr-cal Oct 31, 2023
1b83ee9
feat(linter): show missing libraries corresponding package
syu-w Oct 31, 2023
09965ed
tests(spread): add remote-build spread test
mr-cal Oct 31, 2023
142ba8d
chore(log): hide command in output when pack failed (#4434)
syu-w Nov 3, 2023
2f28be5
ci: colorize tox and collapse sections (#4435)
mr-cal Nov 3, 2023
32a27d6
build(deps): bump craft-providers to 1.19.2 (#4437)
mr-cal Nov 3, 2023
1217381
docs(architectures): remove shorthand notation for core22 architectur…
mr-cal Nov 7, 2023
6eba18e
feat: enable chisel (#4441)
sergiusens Nov 8, 2023
ca40ab0
feat: improve lifecycle messages (#4431)
sergiusens Nov 13, 2023
43e401c
chore(ci): publish snaps for feature/ branches (#4447)
tigarmo Nov 13, 2023
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
22 changes: 18 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: CI

on:
pull_request:
push:
branches:
- "feature/**"

jobs:
publish:
Expand Down Expand Up @@ -38,11 +41,22 @@ jobs:
# Make sure it is installable.
sudo snap install --dangerous --classic ${{ steps.build.outputs.snap }}

- if: steps.decisions.outputs.PUBLISH == 'true' && github.event_name == 'pull_request'
# Use this until snapcore/action-publish#27 it is merged.
uses: sergiusens/action-publish@master
- name: Get branch name
id: vars
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]
then
echo "branch=pr-${{ github.event.number }}" >> "$GITHUB_OUTPUT"
else
branch=$(echo ${GITHUB_REF#refs/*/} | sed -e 's|feature/\(.*\)|\1|')
echo "branch=$branch" >> "$GITHUB_OUTPUT"
fi

- name: Publish feature branch to edge/${{ steps.vars.outputs.branch }}
if: steps.decisions.outputs.PUBLISH == 'true'
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
with:
snap: ${{ steps.build.outputs.snap }}
release: edge/pr-${{ github.event.number }}
release: edge/${{ steps.vars.outputs.branch }}
27 changes: 26 additions & 1 deletion .github/workflows/spread-scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
schedule:
# At 03:00 on Wednesday and Sunday.
- cron: "0 3 * * WED,SUN"

workflow_dispatch:

jobs:
Expand Down Expand Up @@ -51,3 +50,29 @@ jobs:
- name: Kernel plugin test
run: |
spread google:ubuntu-22.04-64:tests/spread/plugins/${{ matrix.type }}/kernel

remote-build:
runs-on: self-hosted
needs: [snap-build]
strategy:
fail-fast: false
steps:
- name: Cleanup job workspace
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- name: Checkout snapcraft
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Download snap artifact
uses: actions/download-artifact@v3
with:
name: snap
path: tests
- name: remote-build test
env:
LAUNCHPAD_TOKEN: "${{ secrets.LAUNCHPAD_TOKEN }}"
run: |
spread google:ubuntu-20.04-64:tests/spread/general/remote-build
16 changes: 7 additions & 9 deletions .github/workflows/tox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,23 @@ jobs:
python -m pip install 'tox<5.0' tox-gh
echo "::endgroup::"
echo "::group::Create virtual environments for linting processes."
tox run -m lint build-docs --notest
tox run --colored yes -m lint build-docs --notest
echo "::endgroup::"
echo "::group::Build docs."
tox run -e build-docs
tox run --colored yes -e build-docs
echo "::endgroup::"
echo "::group::Wait for snap to complete"
snap watch --last=install
echo "::endgroup::"
- name: Run Linters
run: tox run --skip-pkg-install -m lint
run: tox run --colored yes --skip-pkg-install -m lint
tests:
strategy:
fail-fast: false # Run all the tests to their conclusions.
matrix:
platform: [ubuntu-20.04, ubuntu-22.04]
python_version: ["3.8", "3.10"]
platform: [ubuntu-22.04]
python_version: ["3.10"]
include:
- python_version: "3.8"
tox_python: py38
- python_version: "3.10"
tox_python: py310
runs-on: ${{ matrix.platform }}
Expand All @@ -80,9 +78,9 @@ jobs:
echo "::endgroup::"
mkdir -p results
- name: Setup Tox environments
run: tox run-parallel --parallel auto --parallel-no-spinner --parallel-live -e test-${{ matrix.tox_python }},test-legacy-${{ matrix.tox_python }} --notest
run: tox run-parallel --parallel auto --parallel-no-spinner --parallel-live --colored yes -e test-${{ matrix.tox_python }},test-legacy-${{ matrix.tox_python }} --notest
- name: Test with tox
run: tox run --skip-pkg-install --result-json results/tox-${{ matrix.platform }}.json -e test-${{ matrix.tox_python }},test-legacy-${{ matrix.tox_python }}
run: tox run --skip-pkg-install --result-json results/tox-${{ matrix.platform }}.json --colored yes -e test-${{ matrix.tox_python }},test-legacy-${{ matrix.tox_python }}
- name: Upload code coverage
uses: codecov/codecov-action@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ test-shellcheck:

.PHONY: test-legacy-units
test-legacy-units:
tox run -e py38-legacy
tox run -e test-legacy-py310

.PHONY: test-units
test-units: test-legacy-units
tox run -e py38-unit
tox run -e test-py310

.PHONY: tests
tests: tests-static test-units
Expand Down
4 changes: 2 additions & 2 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ For example:
* To run only the unit tests for the plugins:

```
pytest tests/unit/plugins
pytest tests/unit/parts/plugins
```

* To run only the integration tests for the store:

```
pytest tests/integration/store
pytest tests/unit/store
```

The snaps tests script has more complex arguments. For an explanation of them, run:
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ environment:
TIMESTAMP_SERVICE: http://timestamp.digicert.com

matrix:
- PYTHON: C:\Python38-x64
- PYTHON: C:\Python310-x64

cache:
- '%LOCALAPPDATA%\pip\Cache\http'
Expand Down
2 changes: 1 addition & 1 deletion docs/.sphinx/pinned-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tornado==6.3.3
urllib3==1.26.17
urllib3==1.26.18
13 changes: 0 additions & 13 deletions docs/howto/architectures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ following snippet snippet will produce the same result:
architectures:
- build-on: [amd64]

The shorthand format will also produce the same result:

.. code-block:: yaml

architectures:
- amd64

core20
^^^^^^

Expand Down Expand Up @@ -97,12 +90,6 @@ following snippet snippet will produce the same result:
- build-on: [amd64]
- build-on: [arm64]

The shorthand format will also produce the same result:

.. code-block:: yaml

architectures: [amd64, arm64]

core20
^^^^^^

Expand Down
24 changes: 13 additions & 11 deletions docs/reference/architectures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,20 @@ use the ``all`` keyword.

The same architecture cannot be defined in multiple ``build-for`` entries.

core20
^^^^^^

The above syntax and rules for ``core22`` apply for ``core20`` except that
``run-on`` is used in place of ``build-for``. Additionally, ``core20`` supports
multiple architectures in the ``run-on`` field, which will create
multi-architecture snaps.

Shorthand format
""""""""""""""""

As an alternative to the explicit format described above, a shorthand format
can be used for simple ``build-on/build-for`` pairs. The following shorthand:
As an alternative to the explicit format described above, ``core20`` snaps
support a shorthand format can be used for simple ``build-on/run-on``
pairs. The following shorthand:

.. code-block:: yaml

Expand All @@ -87,19 +96,12 @@ is equivalent to:

architectures:
- build-on: [amd64]
build-for: [amd64]
run-on: [amd64]
- build-on: [arm64]
build-for: [arm64]
run-on: [arm64]

The explicit and shorthand format cannot be mixed.

core20
^^^^^^

The above syntax and rules for ``core22`` apply for ``core20`` except that
``run-on`` is used in place of ``build-for``. Additionally, ``core20`` supports
multiple architectures in the ``run-on`` field, which will create
multi-architecture snaps.

Project variables
-----------------
Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ attrs==23.1.0
catkin-pkg==0.5.2
click==8.1.3
craft-archives==1.1.3
craft-cli==2.1.0
craft-cli==2.4.0
craft-grammar==1.1.1
craft-parts==1.25.1
craft-providers==1.15.0
craft-providers==1.19.2
craft-store==2.4.0
Deprecated==1.2.13
distro==1.8.0
Expand Down
26 changes: 20 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extend-exclude = '''
'''
# Targeting future versions as well so we don't have black reformatting code
# en masse later.
target_version = ["py38", "py310", "py311"]
target_version = ["py310", "py311"]

[tool.isort]
# black-compatible isort configuration
Expand Down Expand Up @@ -48,7 +48,7 @@ load-plugins = "pylint_fixme_info,pylint_pytest"
min-similarity-lines=10

[tool.mypy]
python_version = 3.8
python_version = "3.10"
ignore_missing_imports = true
follow_imports = "silent"
exclude = [
Expand All @@ -65,16 +65,17 @@ plugins = [

[tool.pyright]
include = ["snapcraft", "tests"]
exclude = ["tests/legacy", "tests/spread", "build"]
pythonVersion = "3.8"
exclude = ["build", "tests/legacy", "tests/spread"]
pythonVersion = "3.10"

[tool.pytest.ini_options]
minversion = 7.0
minversion = "7.0"
required_plugins = ["pytest-cov>=4.0", "pytest-mock>=3.10", "pytest-subprocess>=1.4"]
addopts = ["--cov=snapcraft"]

# Most of this ruff configuration comes from craft-parts
[tool.ruff]
target-version = "py310"
line-length = 88
extend-exclude = [
"docs",
Expand Down Expand Up @@ -149,9 +150,17 @@ ignore = [
"C405", "C408", "C414",
"Q000", # 2 single-quoted strings - probably accidental
"RET504", "RET506", # Return value related.

"PLR2004", # Magic values - widely used
"PLC1901", # Checking for empty string vs. falsey - many of these
"S603", # Untrusted input for subprocess calls
"S604", # shell=True parameter to a function
"S607", # Partial executable path for subprocess calls
]

[tool.ruff.pylint]
max-args = 6
max-branches = 16

[tool.ruff.per-file-ignores]
"tests/**.py" = [
"D", # Ignore docstring rules in tests
Expand All @@ -162,6 +171,11 @@ ignore = [
"S105", # Allow Possible hardcoded password.
"S106", # Allow Possible hardcoded password.
"S108", # Allow Probable insecure usage of temporary file or directory.
"PLR0913", # Allow many arguments to tests
]
"tests/unit/parts/plugins/test_kernel.py" = [
"E101", # Mixed tabs and spaces. Ruff gets confused by tabs in multiline strings
"W191", # Indentation contains tabs - another Ruff false positive
]
"__init__.py" = ["I001"] # Imports in __init__ filesare allowed to be out of order

Expand Down
8 changes: 4 additions & 4 deletions requirements-devel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ codespell==2.2.4
colorama==0.4.6
coverage==7.2.5
craft-archives==1.1.3
craft-cli==2.1.0
craft-cli==2.4.0
craft-grammar==1.1.1
craft-parts==1.25.1
craft-providers==1.15.0
craft-providers==1.19.2
craft-store==2.4.0
cryptography==41.0.4
Deprecated==1.2.13
Expand Down Expand Up @@ -95,7 +95,7 @@ raven==6.10.0
requests==2.31.0
requests-toolbelt==1.0.0
requests-unixsocket==0.3.0
ruff==0.0.220
ruff==0.1.1
SecretStorage==3.3.3
simplejson==3.19.1
six==1.16.0
Expand All @@ -117,7 +117,7 @@ types-setuptools==67.7.0.2
types-tabulate==0.9.0.2
types-urllib3==1.26.25.13
typing_extensions==4.5.0
urllib3==1.26.17
urllib3==1.26.18
venusian==3.0.0
virtualenv==20.23.0
wadllib==1.3.6
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ chardet==5.1.0
charset-normalizer==3.1.0
click==8.1.3
craft-archives==1.1.3
craft-cli==2.1.0
craft-cli==2.4.0
craft-grammar==1.1.1
craft-parts==1.25.1
craft-providers==1.15.0
craft-providers==1.19.2
craft-store==2.4.0
cryptography==41.0.4
Deprecated==1.2.13
Expand Down Expand Up @@ -67,7 +67,7 @@ toml==0.10.2
types-Deprecated==1.2.9.2
types-PyYAML==6.0.12.9
typing_extensions==4.5.0
urllib3==1.26.17
urllib3==1.26.18
wadllib==1.3.6
wrapt==1.15.0
ws4py==0.5.1
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def recursive_data_files(directory, install_directory):
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Build Tools",
"Topic :: System :: Software Distribution",
]
Expand Down Expand Up @@ -82,7 +82,7 @@ def recursive_data_files(directory, install_directory):
"pytest-cov",
"pytest-mock",
"pytest-subprocess",
"ruff==0.0.220",
"ruff~=0.1.1",
"tox>=4.5",
"types-PyYAML",
"types-requests",
Expand Down
Loading