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

Modernize package #20

Merged
merged 6 commits into from
Jan 26, 2025
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
16 changes: 12 additions & 4 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Checkout source
uses: actions/checkout@v4
with:
python-version: 3.x
- run: |
fetch-depth: 0

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

- name: Install environment and run mkdocs-deploy
run: |
python -m pip install --upgrade pip
pip install .
python --version
pip install mkdocs-material
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,25 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: "3.11"

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

- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
python -m build
python -m twine upload dist/*
22 changes: 10 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,34 @@ jobs:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

name: Set up Python ${{ matrix.python-version }}
name: Run tests with Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
uses: actions/setup-python@v4
with:
channels: conda-forge,defaults
channel-priority: true
python-version: ${{ matrix.python-version }}
auto-update-conda: true

- name: Install dev environment & flexitext
shell: bash -l {0}
run: |
conda install pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
python -m pip install --upgrade pip
pip install .
python --version
conda list
pip install .[dev]
pip freeze

- name: Run linters
shell: bash -l {0}
run: |
python -m black -l 100 flexitext --check
echo "Success!"
echo "Checking code style with pylint..."
python -m pylint flexitext/

- name: Run tests
shell: bash -l {0}
run: |
Expand All @@ -52,8 +49,9 @@ jobs:
PYTHON_VERSION: ${{ matrix.python-version }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v5
with:
env_vars: OS,PYTHON
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
File renamed without changes.
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

5 changes: 3 additions & 2 deletions flexitext/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from .flexitext import FlexiText, flexitext
from importlib.metadata import version

from .flexitext import FlexiText, flexitext
from .style import Style

from .version import __version__
__version__ = version("flexitext")

__all__ = ["flexitext", "FlexiText", "Style"]
5 changes: 0 additions & 5 deletions flexitext/version.py

This file was deleted.

42 changes: 41 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=61.0", "setuptools_scm>=8"]

[tool.setuptools_scm]


[project]
name = "flexitext"
description = "Draw styled text in Matplotlib"
requires-python = ">=3.6"
dependencies = ["matplotlib>=3.4"]
readme = "README.md"
license = {file = "LICENSE"}
dynamic = ["version"]
maintainers = [{ name = "Tomás Capretto", email = "[email protected]" }]
classifiers = ["Framework :: Matplotlib"]

[project.optional-dependencies]
dev = [
"black==24.10.0",
"pylint==3.3.3",
"pytest-cov>=2.6.1",
"pytest>=4.4.0",
]


[project.urls]
homepage = "https://tomicapretto.com/flexitext"
documentation = "https://tomicapretto.com/flexitext"
repository = "https://github.com/tomicapretto/flexitext"
changelog = "https://github.com/tomicapretto/flexitext/blob/main/CHANGELOG.md"


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

[tool.setuptools.package-data]
"*" = ["*.txt", "*.md"]

[tool.black]
line-length = 100
target-version = ["py310"]
target-version = ["py311"]
4 changes: 0 additions & 4 deletions requirements-dev.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

4 changes: 0 additions & 4 deletions setup.cfg

This file was deleted.

42 changes: 0 additions & 42 deletions setup.py

This file was deleted.

Loading