Skip to content

Commit b25d644

Browse files
committed
Merge remote-tracking branch 'origin/topic/awelzel/switch-to-github-action'
* origin/topic/awelzel/switch-to-github-action: Switch to pyproject.toml Drop travis.yml, add .github/workflows
2 parents aaf31ee + 1eb4be7 commit b25d644

4 files changed

Lines changed: 98 additions & 63 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Test, build and publish package
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
name: Run tests
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
14+
15+
steps:
16+
- uses: actions/checkout@v6
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v6
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install some dependencies for testing
22+
run: python3 -m pip install flake8 flake8-bugbear flake8-import-order flake8-simplify flake8-bandit
23+
- name: Install this plugin with pip, too
24+
run: python3 -m pip install .
25+
- name: Run tests
26+
run: python3 -m unittest discover -s ./tests -v
27+
28+
build:
29+
name: Build a distribution package
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v6
33+
with:
34+
persist-credentials: false
35+
- name: Set up Python
36+
uses: actions/setup-python@v6
37+
with:
38+
python-version: "3.x"
39+
- name: Install pypa/build
40+
run: python3 -m pip install build --user
41+
- name: Build a binary wheel and a source tarball
42+
run: python3 -m build
43+
- name: Store the distribution packages
44+
uses: actions/upload-artifact@v5
45+
with:
46+
name: python-package-distributions
47+
path: dist/
48+
49+
publish-to-pypi:
50+
name: Publish to PyPI
51+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
52+
needs:
53+
- build
54+
- test
55+
runs-on: ubuntu-latest
56+
57+
environment:
58+
name: pypi
59+
url: https://pypi.org/p/flake8-gl-codeclimate
60+
61+
permissions:
62+
id-token: write # IMPORTANT: mandatory for trusted publishing
63+
64+
steps:
65+
- name: Download all the dists
66+
uses: actions/download-artifact@v6
67+
with:
68+
name: python-package-distributions
69+
path: dist/
70+
- name: Publish distribution package to PyPI
71+
uses: pypa/gh-action-pypi-publish@release/v1

.travis.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

pyproject.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[build-system]
2+
requires = ["setuptools >= 77.0.3", "setuptools_scm"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "flake8-gl-codeclimate"
7+
description = "Gitlab Code Quality artifact Flake8 formatter"
8+
authors = [
9+
{name = "Arne Welzel", email = "arne.welzel@gmail.com"},
10+
]
11+
readme = "README.md"
12+
license = "MIT"
13+
license-files = ["LICENSE"]
14+
dynamic = ["version"]
15+
dependencies = [
16+
"flake8 >= 7.3.0",
17+
]
18+
19+
[project.entry-points."flake8.report"]
20+
gl-codeclimate = "flake8_gl_codeclimate:GitlabCodeClimateFormatter"
21+
22+
[tool.setuptools]
23+
packages = ["flake8_gl_codeclimate"]
24+
25+
[tool.setuptools_scm]

setup.py

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,2 @@
1-
import setuptools
2-
3-
setuptools.setup(
4-
name="flake8-gl-codeclimate",
5-
license="MIT",
6-
use_scm_version=True,
7-
description="Gitlab Code Quality artifact Flake8 formatter.",
8-
author="Arne Welzel",
9-
author_email="arne.welzel@gmail.com",
10-
url="https://github.com/awelzel/flake8-gl-codeclimate",
11-
packages=[
12-
"flake8_gl_codeclimate",
13-
],
14-
install_requires=[
15-
"flake8 > 3.0.0",
16-
],
17-
setup_requires=[
18-
"setuptools_scm",
19-
],
20-
scripts=[
21-
"scripts/report-to-gl-codeclimate.py",
22-
],
23-
entry_points={
24-
"flake8.report": [
25-
'gl-codeclimate = flake8_gl_codeclimate:GitlabCodeClimateFormatter',
26-
],
27-
}
28-
)
1+
from setuptools import setup
2+
setup()

0 commit comments

Comments
 (0)