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

fix: deprecate older pythons and fix up some configs #44

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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 }}
Copy link
Contributor Author

@c0state c0state Jun 22, 2024

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

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
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']

Choose a reason for hiding this comment

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

@c0state Removal of python versions may necessitate a version bump, as fourmat is meant to be consumed as a lib


[tool.isort]
profile = "black"
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@
author="Giacomo Tagliabue",
author_email="[email protected]",
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",
"flake8-bugbear>=24,<25",
"flake8>=7,<8",
"isort>=5,<6",
"setuptools>=70",
),
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