Skip to content

Commit

Permalink
Merge pull request #22 from arvkevi/new_packaging_guidelines
Browse files Browse the repository at this point in the history
New packaging guidelines
  • Loading branch information
arvkevi authored Oct 17, 2022
2 parents 3c22092 + 2a9177c commit 084c660
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.2
current_version = 0.2.3
commit = True
tag = True

Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,6 @@ jobs:
toxpython: 'python3.9'
tox_env: 'docs'
os: 'ubuntu-latest'
- name: 'py36 (ubuntu)'
python: '3.6'
toxpython: 'python3.6'
python_arch: 'x64'
tox_env: 'py36'
os: 'ubuntu-latest'
- name: 'py36 (windows)'
python: '3.6'
toxpython: 'python3.6'
python_arch: 'x64'
tox_env: 'py36'
os: 'windows-latest'
- name: 'py36 (macos)'
python: '3.6'
toxpython: 'python3.6'
python_arch: 'x64'
tox_env: 'py36'
os: 'macos-latest'
- name: 'py37 (ubuntu)'
python: '3.7'
toxpython: 'python3.7'
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
year = "2022"
author = "Kevin Arvai"
copyright = "{0}, {1}".format(year, author)
version = release = "0.2.2"
version = release = "0.2.3"

pygments_style = "trac"
templates_path = ["."]
Expand Down
61 changes: 52 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,58 @@
[build-system]
requires = [
"setuptools>=30.3.0",
"wheel",
"matplotlib",
"scikit-learn",
"numpy",
"pillow",
"kneed"
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "img2cmap"
version = "0.2.3"
authors = [
{ name="Kevin Arvai", email="[email protected]" },
{ name="Marshall Krassenstein", email="[email protected]"},
]
description = "Create colormaps from images"
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"License :: OSI Approved :: MIT License",
"Development Status :: 2 - Pre-Alpha",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Operating System :: Unix",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Utilities",
]
keywords = ["colormap", "matplotlib", "kmeans", "data visualization"]
dependencies = [
"matplotlib>=3.4.2",
"scikit-learn>=0.24.2",
"numpy>=1.20.3",
"pillow>=8.0.1",
"kneed >=0.8.1",
]

[project.optional-dependencies]
dev = ["black", "requests", "tox"]
streamlit= ["streamlit", "st-annotated-text"]
all = ["black", "requests", "tox", "streamlit", "st-annotated-text"]

[project.license]
file = "LICENSE"

[project.urls]
"Homepage" = "https://github.com/arvkevi/kneed"
"Bug Tracker" = "https://github.com/arvkevi/kneed/issues"

[tool.black]
line-length = 140
target-version = ['py36']
target-version = ['py37', 'py38', 'py39', 'py310']
skip-string-normalization = false
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.exclude-package-data]
img2cmap = ["tests"]

[flake8]
max-line-length = 140
exclude = .tox,.eggs,ci/templates,build,dist
Expand Down
76 changes: 1 addition & 75 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,80 +1,6 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-

import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext

from setuptools import find_packages
from setuptools import setup


def read(*names, **kwargs):
with io.open(join(dirname(__file__), *names), encoding=kwargs.get("encoding", "utf8")) as fh:
return fh.read()


setup(
name="img2cmap",
version="0.2.2",
license="MIT",
description="Create colormaps from images",
long_description="{}\n{}".format(
re.compile("^.. start-badges.*^.. end-badges", re.M | re.S).sub("", read("README.rst")),
re.sub(":[a-z]+:`~?(.*?)`", r"``\1``", read("CHANGELOG.rst")),
),
author="Kevin Arvai",
author_email="[email protected]",
url="https://github.com/arvkevi/img2cmap",
packages=find_packages("src", exclude=["tests*"]),
package_dir={"": "src"},
py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")],
include_package_data=True,
zip_safe=False,
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: Unix",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Utilities",
],
project_urls={
"Documentation": "https://img2cmap.readthedocs.io/",
"Changelog": "https://img2cmap.readthedocs.io/en/latest/changelog.html",
"Issue Tracker": "https://github.com/arvkevi/img2cmap/issues",
},
keywords=[
"matplotlib",
"colormap",
"image",
],
python_requires=">=3.6",
install_requires=[
"matplotlib",
"scikit-learn",
"numpy",
"pillow",
"kneed",
],
extras_require={
"dev": ["black", "requests", "tox"],
"streamlit": ["streamlit", "st-annotated-text"],
"all": ["black", "requests", "tox", "streamlit", "st-annotated-text"],
},
)
setup()
2 changes: 1 addition & 1 deletion src/img2cmap/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .convert import ImageConverter # noqa: F401, E999

__version__ = "0.2.2"
__version__ = "0.2.3"
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ envlist =
clean,
check,
docs,
{py36,py37,py38,py39,py310},
{py37,py38,py39,py310},
report
ignore_basepython_conflict = true

[testenv]
basepython =
py36: {env:TOXPYTHON:python3.6}
py37: {env:TOXPYTHON:python3.7}
py38: {env:TOXPYTHON:python3.8}
py39: {env:TOXPYTHON:python3.9}
Expand Down

0 comments on commit 084c660

Please sign in to comment.