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
20 changes: 19 additions & 1 deletion .github/workflows/main.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.5, 3.6, 3.7, 3.8, 3.9]
python: [3.8, 3.9, "3.10"]
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies
run: |
pip install tox
- name: Run lint
run: tox -e flake8
lint-old-python:
name: Lint on older Python versions
runs-on: ubuntu-20.04
strategy:
matrix:
python: [3.5, 3.6, 3.7]
steps:
- name: Check out code
uses: actions/checkout@v2
Expand Down
25 changes: 18 additions & 7 deletions tox.ini
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,20 +4,29 @@ envlist = flake8, py3
skip_missing_interpreters = True

[testenv]
commands = /bin/bash -c 'py.test -v'

allowlist_externals =
/bin/bash
deps =
-r{toxinidir}/requirements.txt
commands = /bin/bash -c 'py.test -v'

[testenv:flake8]
commands = flake8 reactive lib tests unit_tests

[testenv:func]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = ln mkdir readlink rm juju
setenv = CHARM_LAYERS_DIR=/tmp/charm-builds/_tmp/layers
passenv = HOME
allowlist_externals =
/bin/bash
/bin/ln
/bin/mkdir
/bin/readlink
/bin/rm
/snap/bin/juju
setenv =
CHARM_LAYERS_DIR=/tmp/charm-builds/_tmp/layers
passenv =
HOME
commands =
/bin/rm -rf /tmp/charm-builds/_tmp /tmp/charm-builds/minimal
/bin/rm -rf /tmp/charm-builds/_tmp /tmp/charm-builds/minimal-binary-wheels
Expand All@@ -32,6 +41,8 @@ commands =


[flake8]
# E741: ambiguous variable name
# W504: # line break after binary operator (have to ignore either this or W503)
ignore =
E741, # ambiguous variable name
W504 # line break after binary operator (have to ignore either this or W503)
E741,
W504
7 changes: 6 additions & 1 deletion wheelhouse.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,8 +10,13 @@ Jinja2==2.10;python_version >= '3.0' and python_version <= '3.4' # py3 trusty
Jinja2==2.11;python_version == '2.7' or python_version == '3.5' # py27, py35
Jinja2;python_version >= '3.6' # py36 and on

# Cython is required to build PyYAML. To find out the supported versions check
# https://github.com/cython/cython/issues/2800
Cython

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure because of this change, but a reactive charm has failed to build over the weekend. It's failing at Cython installation due to missing (Python.h: python3-dev).

Are you going to manage this dependency centrally or do you expect every single charm to have python3-dev?

2023-04-10 07:13:03.353319 | focal-medium | :: x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/root/snap/charmcraft/common/tmp8fu559sx/include -I/usr/include/python3.10 -c /root/snap/charmcraft/common/pip-install-s2qs0rbg/cython_6d98672645614f43bf70d0b7f222b29d/Cython/Plex/Scanners.c -o build/temp.linux-x86_64-cpython-310/root/snap/charmcraft/common/pip-install-s2qs0rbg/cython_6d98672645614f43bf70d0b7f222b29d/Cython/Plex/Scanners.o
2023-04-10 07:13:03.353337 | focal-medium | :: /root/snap/charmcraft/common/pip-install-s2qs0rbg/cython_6d98672645614f43bf70d0b7f222b29d/Cython/Plex/Scanners.c:21:10: fatal error: Python.h: No such file or directory
2023-04-10 07:13:03.353350 | focal-medium | :: 21 | #include "Python.h"
2023-04-10 07:13:03.353363 | focal-medium | :: | ^~~~~~~~~~
2023-04-10 07:13:03.353375 | focal-medium | :: compilation terminated.
2023-04-10 07:13:03.353640 | focal-medium | :: error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
2023-04-10 07:13:03.353668 | focal-medium | :: [end of output]
2023-04-10 07:13:03.353683 | focal-medium | ::
2023-04-10 07:13:03.353715 | focal-medium | :: note: This error originates from a subprocess, and is likely not a problem with pip.
2023-04-10 07:13:03.353737 | focal-medium | :: error: legacy-install-failure
2023-04-10 07:13:03.353748 | focal-medium | ::
2023-04-10 07:13:03.353759 | focal-medium | :: × Encountered error while trying to install package.
2023-04-10 07:13:03.353770 | focal-medium | :: ╰─> Cython

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll need to make charm-tools grow a feature to allow layers express build-dependencies (and probably stage dependencies).


PyYAML==5.2;python_version >= '3.0' and python_version <= '3.4' # py3 trusty
PyYAML<5.4;python_version == '2.7' or python_version >= '3.5' # all else
PyYAML<5.4;python_version == '2.7' or python_version <= '3.6' # xenial and bionic
PyYAML<7.0.0;python_version >= '3.7' # >= focal

MarkupSafe<2.0.0;python_version < '3.6'
MarkupSafe<2.1.0;python_version == '3.6' # Just for python 3.6
Expand Down