Skip to content

Commit

Permalink
Build tool change to flit
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Milk committed Jan 9, 2024
1 parent 67c2733 commit 8050a11
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 33 deletions.
44 changes: 33 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,50 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Test with pytest
run: |
pip install pytest
pip install pytest-cov
pytest --cov=marsilea/ --cov-report=xml tests/
Upload_to_test_pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
poetry-version: '1.2'
python-version: '3.10'

- name: Install dependencies
run: poetry install
- name: Build the package
run: poetry build
- name: Publish dry run
run: poetry publish --dry-run --skip-existing
run: |
python -m pip install --upgrade pip
pip install flit
pip install .
- name: Publish to test.ipynb pypi
env:
POETRY_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
FLIT_INDEX_URL: https://test.ipynb.pypi.org/legacy/
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: flit publish || exit 0

- name: Publish to pypi
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
run: poetry publish --skip-existing
env:
POETRY_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
FLIT_INDEX_URL: https://upload.pypi.org/legacy/
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: flit publish
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Mr-Milk

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
3 changes: 2 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from cycler import cycler
import legendkit

project = 'legendkit'
copyright = '2024, Mr-Milk'
author = 'Mr-Milk'
release = '0.3.3'
release = legendkit.__version__

extensions = [
'numpydoc',
Expand Down
4 changes: 4 additions & 0 deletions legendkit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""Legend creation and manipulation with ease for matplotlib"""

__version__ = "0.3.3"

from ._colorbar import Colorbar
from ._colorart import ColorArt
from ._legend import ListLegend, CatLegend, SizeLegend
Expand Down
48 changes: 27 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
[tool.poetry]
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "legendkit"
version = "0.3.3"
description = "Legend creation and manipulation with ease for matplotlib"
authors = ["Mr-Milk <[email protected]>"]
license = "MIT"
dynamic = ["version", "description"]
requires-python = ">=3.8"
authors = [
{name = "Mr-Milk", email = "[email protected]", role = "maintainer"},
]
license = {file = "LICENSE"}
readme = "README.md"
repository = "https://github.com/Heatgraphy/legendkit"
urls = {Home = "https://github.com/Marsilea-viz/legendkit"}
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
Expand All @@ -14,19 +20,19 @@ classifiers = [
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: Visualization"
]
dependencies = [
"matplotlib"
]


[tool.poetry.dependencies]
python = ["^3.8"]
matplotlib = "^3.6"

[tool.poetry.group.dev.dependencies]
Sphinx = "^6.0.0"
sphinx-gallery = "^0.11.1"
furo = "^2022.6.21"
pytest = "^7.1.2"
numpydoc = "^1.4.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[project.optional-dependencies]
dev = [
"ruff",
"icecream",
"python-hmr",
"pytest",
"scikit-learn",
"sphinx",
"numpydoc",
"sphinx_gallery",
"furo",
]

0 comments on commit 8050a11

Please sign in to comment.