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
71 changes: 71 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Test, build and publish package

on:
push:
pull_request:

jobs:
test:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install some dependencies for testing
run: python3 -m pip install flake8 flake8-bugbear flake8-import-order flake8-simplify flake8-bandit
- name: Install this plugin with pip, too
run: python3 -m pip install .
- name: Run tests
run: python3 -m unittest discover -s ./tests -v

build:
name: Build a distribution package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install pypa/build
run: python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v5
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
- test
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/flake8-gl-codeclimate

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: python-package-distributions
path: dist/
- name: Publish distribution package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[build-system]
requires = ["setuptools >= 77.0.3", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[project]
name = "flake8-gl-codeclimate"
description = "Gitlab Code Quality artifact Flake8 formatter"
authors = [
{name = "Arne Welzel", email = "arne.welzel@gmail.com"},
]
readme = "README.md"
license = "MIT"
license-files = ["LICENSE"]
dynamic = ["version"]
dependencies = [
"flake8 >= 7.3.0",
]

[project.entry-points."flake8.report"]
gl-codeclimate = "flake8_gl_codeclimate:GitlabCodeClimateFormatter"

[tool.setuptools]
packages = ["flake8_gl_codeclimate"]

[tool.setuptools_scm]
30 changes: 2 additions & 28 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,2 @@
import setuptools

setuptools.setup(
name="flake8-gl-codeclimate",
license="MIT",
use_scm_version=True,
description="Gitlab Code Quality artifact Flake8 formatter.",
author="Arne Welzel",
author_email="arne.welzel@gmail.com",
url="https://github.com/awelzel/flake8-gl-codeclimate",
packages=[
"flake8_gl_codeclimate",
],
install_requires=[
"flake8 > 3.0.0",
],
setup_requires=[
"setuptools_scm",
],
scripts=[
"scripts/report-to-gl-codeclimate.py",
],
entry_points={
"flake8.report": [
'gl-codeclimate = flake8_gl_codeclimate:GitlabCodeClimateFormatter',
],
}
)
from setuptools import setup
setup()
Loading