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

Enable poetry workflow #236

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
cabf30b
optionally use tox pack
jdkandersson Jan 16, 2024
03a903c
install tox
jdkandersson Jan 16, 2024
cebc5c2
correct or operator
jdkandersson Jan 16, 2024
a2865c4
Use the tox wrapper for charmcraft
nrobinaubertin Feb 26, 2024
363c392
Add tox install before charm packing
nrobinaubertin Feb 26, 2024
3da89c0
Install poetry for unit tests
nrobinaubertin Feb 26, 2024
c34532e
Add poetry-export-plugin
nrobinaubertin Feb 26, 2024
9018b2a
Fix poetry-plugin-export install
nrobinaubertin Feb 26, 2024
0eda72c
Remove deps test incompatible with poetry
nrobinaubertin Feb 26, 2024
19be9ed
Fall back to plain charmcraft when `tox pack` fails
nrobinaubertin Feb 26, 2024
e682e7c
Merge origin/charmcraft-tox-wrapper
nrobinaubertin Feb 26, 2024
d81c860
Install poetry in integration_test wf
nrobinaubertin Feb 26, 2024
902ab08
Remove poetry install (will be done from tox)
nrobinaubertin Feb 27, 2024
76c534a
Merge branch 'main' into dependency-version-pin
nrobinaubertin Feb 29, 2024
6ec606d
Merge origin/main
nrobinaubertin May 6, 2024
7c5d447
Test tox pack
nrobinaubertin May 6, 2024
5885ca3
Merge branch 'main' into dependency-version-pin
nrobinaubertin May 6, 2024
f8e5e5d
Build
nrobinaubertin May 6, 2024
f60f3ea
Merge
nrobinaubertin May 6, 2024
486fe85
Merge branch 'main' into dependency-version-pin
nrobinaubertin May 7, 2024
10aa71f
Merge branch 'main' into dependency-version-pin
nrobinaubertin May 7, 2024
3e56a33
Point to the modified branch for the build plan
nrobinaubertin May 7, 2024
782048e
Merge branch 'dependency-version-pin' of github.com:canonical/operato…
nrobinaubertin May 7, 2024
62dc359
Support poetry and classic wfs
nrobinaubertin May 7, 2024
ad1425b
Merge branch 'main' into dependency-version-pin
nrobinaubertin May 7, 2024
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
3 changes: 2 additions & 1 deletion .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ jobs:
working-directory: ${{ inputs.working-directory }}
run: |
sudo snap install charmcraft --classic --channel latest/stable
charmcraft pack -v
python3 -m pip install tox
tox -e pack -- -v || charmcraft pack -v
echo "CHARM_FILE=$(ls $CHARM_NAME_*.charm || echo UNKNOWN)" >> $GITHUB_ENV
- name: Upload charm artifact
if: ${{ !contains(fromJson('["", "UNKNOWN"]'), env.CHARM_FILE) && !cancelled() }}
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,51 +216,6 @@ jobs:
STDOUT_LOG=$(mktemp --suffix=stdout.log)
echo STDOUT_LOG=$STDOUT_LOG >> $GITHUB_ENV
tox --result-json=test-result.json | tee $STDOUT_LOG ; test ${PIPESTATUS[0]} -eq 0
- name: Check lint and test stdout
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the reason for removing this please?

Copy link
Contributor

Choose a reason for hiding this comment

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

When using poetry, the dependencies will be handled in the pyproject.toml file and this test will always fail

Copy link
Contributor Author

@jdkandersson jdkandersson Mar 1, 2024

Choose a reason for hiding this comment

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

Could it somehow be adapted so that we still get the benefits please? It is checking here that the expected tools are being run which is quite helpful to make sure that the expected linting is actually being done in a given repo

run: |
# Check dependencies
EXPECTED_LINT_DEPS="\
mypy \
isort \
black \
flake8-docstrings \
flake8-docstrings-complete \
flake8-builtins \
flake8-test-docs \
pep8-naming \
codespell \
pylint \
pydocstyle \
"
for EXPECTED_LINT_DEP in $EXPECTED_LINT_DEPS; do
# Check that there is a `lint...<dependency>` line for each of the expected dependencies
DEP_REGEX="lint.*$EXPECTED_LINT_DEP"
if ! grep -q "$DEP_REGEX" $STDOUT_LOG ; then
# Write to stderr
>&2 echo "$EXPECTED_LINT_DEP should be in deps of [testenv:lint] environment in tox.ini"
exit 1
fi
done

# Check commands
EXPECTED_LINT_CMDS="\
pydocstyle \
codespell \
flake8 \
isort \
black \
mypy \
pylint \
"
for EXPECTED_LINT_CMD in $EXPECTED_LINT_CMDS; do
# Check that there is a `lint...commands...<command>` line for each of the expected commands
CMD_REGEX="lint.*commands.*$EXPECTED_LINT_CMD"
if ! grep -q "$CMD_REGEX" $STDOUT_LOG ; then
# Write to stderr
>&2 echo "$EXPECTED_LINT_CMD should be in commands of [testenv:lint] environment in tox.ini"
exit 1
fi
done
- name: Export test report
if: always() && !cancelled()
uses: actions/[email protected]
Expand Down
Loading