Skip to content

Commit

Permalink
Minor lint fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed May 31, 2024
1 parent 7962fe6 commit 41a15a8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 33 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# SPDX-FileCopyrightText: Contributors to the Fedora Project
#
# SPDX-License-Identifier: LGPL-3.0-or-later
---

name: Test & Build
on: [push, pull_request]
jobs:

tests:
runs-on: ubuntu-latest
container: fedorapython/fedora-python-tox:latest
Expand Down Expand Up @@ -35,7 +30,6 @@ jobs:
- tests

steps:

- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
Expand All @@ -54,18 +48,17 @@ jobs:
name: python-package-distributions
path: dist/


publish-to-pypi:
name: Publish to PyPI 🚀
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'rc') # only publish to PyPI on final tag pushes
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'rc') # only publish to PyPI on final tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/tahrir-messages
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
Expand All @@ -77,15 +70,14 @@ jobs:
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1


github-release:
name: Create a GitHub Release 📢
needs:
- publish-to-pypi
runs-on: ubuntu-latest
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2024 Contributors to the Fedora Project
#
# SPDX-License-Identifier: LGPL-3.0-or-later

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2024 Contributors to the Fedora Project
#
# SPDX-License-Identifier: LGPL-3.0-or-later

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

Expand Down
10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2024 Contributors to the Fedora Project
#
# SPDX-License-Identifier: LGPL-3.0-or-later

[tool.poetry]
name = "tahrir-messages"
version = "1.0.2"
Expand Down Expand Up @@ -47,12 +43,14 @@ reuse = ">=1.1.0"
line-length = 100

[tool.ruff]
select = ["E", "F", "W", "I", "UP", "S", "B", "RUF"]
line-length = 100
target-version = "py38"
# ignore = ["RUF010", "UP038"]

[tool.ruff.per-file-ignores]
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "S", "B", "RUF"]

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101"]
"tahrir_messages/__init__.py" = ["F401"]

Expand Down
6 changes: 3 additions & 3 deletions tests/test_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_person_login_first():
message.validate()

expected_summary = "dudemcpants logged into badges for the first time"
assert message.topic == "person.login.first"
assert message.topic == "badges.person.login.first"
assert message.summary == expected_summary
assert str(message) == expected_summary
assert message.agent_name == "dudemcpants"
Expand All @@ -42,7 +42,7 @@ def test_badge_award():
message.validate()

expected_summary = "dudemcpants was awarded the badge `White Hat`"
assert message.topic == "badge.award"
assert message.topic == "badges.badge.award"
assert message.summary == expected_summary
assert str(message) == expected_summary
assert message.agent_name == "dudemcpants"
Expand Down Expand Up @@ -74,7 +74,7 @@ def test_person_rank_advance():
message.validate()

expected_summary = "aaronhale's Badges rank changed from 2 to 1"
assert message.topic == "person.rank.advance"
assert message.topic == "badges.person.rank.advance"
assert message.summary == expected_summary
assert str(message) == expected_summary
assert message.agent_name == "aaronhale"
Expand Down
4 changes: 0 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
; SPDX-FileCopyrightText: 2024 Contributors to the Fedora Project
;
; SPDX-License-Identifier: LGPL-3.0-or-later

[tox]
envlist = py3{8,9,10,11},lint,format
minversion = 3.10.0
Expand Down

0 comments on commit 41a15a8

Please sign in to comment.