From 8050a1186c1074677c4e0669a6ee3951540f6bd5 Mon Sep 17 00:00:00 2001 From: Mr-Milk Date: Tue, 9 Jan 2024 09:47:24 +0100 Subject: [PATCH] Build tool change to flit --- .github/workflows/build.yaml | 44 ++++++++++++++++++++++++--------- LICENSE | 21 ++++++++++++++++ docs/source/conf.py | 3 ++- legendkit/__init__.py | 4 +++ pyproject.toml | 48 ++++++++++++++++++++---------------- 5 files changed, 87 insertions(+), 33 deletions(-) create mode 100644 LICENSE diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5b52ebd..6999490 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,7 +8,7 @@ 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 @@ -16,20 +16,42 @@ jobs: 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 }} \ No newline at end of file + FLIT_INDEX_URL: https://upload.pypi.org/legacy/ + FLIT_USERNAME: __token__ + FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: flit publish \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f178340 --- /dev/null +++ b/LICENSE @@ -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. \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 2187bec..47d0322 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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', diff --git a/legendkit/__init__.py b/legendkit/__init__.py index 2dee989..dabcb58 100644 --- a/legendkit/__init__.py +++ b/legendkit/__init__.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index c43c002..0cbf54d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] -license = "MIT" +dynamic = ["version", "description"] +requires-python = ">=3.8" +authors = [ + {name = "Mr-Milk", email = "yzheng@cemm.at", 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", @@ -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", +] \ No newline at end of file