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
4 changes: 3 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[flake8]
ignore = E,W503 # Let Black handle all the formatting.
ignore =
# Let Black handle all the formatting.
E,W503
exclude =
tests/snapshots,
.svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg
62 changes: 62 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI

on:
push:
branches:
- master
tags:
- "v*.*.*"
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools tox

- name: Run tox
run: tox

deploy:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build setuptools twine wheel

- name: Build package
run: |
python -m build

- name: Publish package to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}

@c0state c0state Jun 22, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Credentials added using my pypi username edit: removed--will use OIDC instead

TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m twine upload dist/*
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ jobs:
- { python: "3.12", env: "TOXENV=py312" }
- { python: "3.11", env: "TOXENV=py311" }
- { python: "3.10", env: "TOXENV=py310" }
- { python: "3.9", env: "TOXENV=py39" }

- stage: Release
if: tag IS present
Expand Down
7 changes: 4 additions & 3 deletions fourmat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from importlib.metadata import PackageNotFoundError, version
from pathlib import Path

import click
from pkg_resources import DistributionNotFound, get_distribution

# -----------------------------------------------------------------------------


try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
__version__ = version(__name__)
except PackageNotFoundError:
# package is not installed
pass

Expand Down
2 changes: 1 addition & 1 deletion fourmat/assets/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 79
target-version = ['py36', 'py37', 'py38', 'py39', 'py310']
target-version = ['py310', 'py311', 'py312']

[tool.isort]
profile = "black"
Expand Down
1 change: 1 addition & 0 deletions fourmat/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

CONFIGURATION_FILES = (".flake8", "pyproject.toml")


# -----------------------------------------------------------------------------
class PathContext:
def __init__(self, path):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 79
target-version = ['py39', 'py310', 'py311', 'py312']
target-version = ['py310', 'py311', 'py312']
Comment thread
c0state marked this conversation as resolved.

[tool.isort]
profile = "black"
Expand Down
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@

setup(
name="fourmat",
version="1.0.0",
version="2.0.0",
description="A library for batteries-included linting and autoformatting",
url="https://github.com/4Catalyzer/fourmat",
author="Giacomo Tagliabue",
author_email="giacomo@gmail.com",
license="MIT",
python_requires=">=3.9",
python_requires=">=3.10",
classifiers=[
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
],
keywords="lint autoformat black flake8 isort",
packages=find_packages(),
package_data={"fourmat": ("assets/*.*", "assets/.*")},
package_data={"fourmat": ["assets/*.*", "assets/.*"]},
install_requires=(
"click>=8",
"black==24.3.0",
"black==25.1.0",
"flake8-bugbear>=24,<25",
"flake8>=7,<8",
"isort>=5,<6",
"isort>=6,<7",
"setuptools>=80",
),
entry_points={"console_scripts": ("fourmat = fourmat:cli",)},
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{36,37,38,39,310}
envlist = py{310,311,312}

[testenv]
usedevelop = True
Expand Down