diff --git a/.gitignore b/.gitignore index e07fb7c..c4a80f8 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ dist build +/*.egg-info diff --git a/__init__.py b/colorpy/__init__.py similarity index 100% rename from __init__.py rename to colorpy/__init__.py diff --git a/blackbody.py b/colorpy/blackbody.py similarity index 100% rename from blackbody.py rename to colorpy/blackbody.py diff --git a/ciexyz.py b/colorpy/ciexyz.py similarity index 100% rename from ciexyz.py rename to colorpy/ciexyz.py diff --git a/colormodels.py b/colorpy/colormodels.py similarity index 100% rename from colormodels.py rename to colorpy/colormodels.py diff --git a/figures.py b/colorpy/figures.py similarity index 100% rename from figures.py rename to colorpy/figures.py diff --git a/illuminants.py b/colorpy/illuminants.py similarity index 100% rename from illuminants.py rename to colorpy/illuminants.py diff --git a/misc.py b/colorpy/misc.py similarity index 100% rename from misc.py rename to colorpy/misc.py diff --git a/plots.py b/colorpy/plots.py similarity index 100% rename from plots.py rename to colorpy/plots.py diff --git a/rayleigh.py b/colorpy/rayleigh.py similarity index 100% rename from rayleigh.py rename to colorpy/rayleigh.py diff --git a/thinfilm.py b/colorpy/thinfilm.py similarity index 100% rename from thinfilm.py rename to colorpy/thinfilm.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a5aa0a0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,33 @@ +[build-system] +requires = ["setuptools>=61.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "colorpy" +version = "0.1.1" +authors = [{name = "Mark Kness", email = "mkness@alumni.utexas.net"}] +license = {text = "LGPL-3.0-or-later"} +description = "Color calculations with physical descriptions of light spectra" + +[project.readme] +text = "ColorPy is a Python package to convert physical descriptions of light spectra of light intensity vs. wavelength - into RGB colors that can be drawn on a computer screen. It provides a nice set of attractive plots that you can make of such spectra, and some other color related functions as well." +content-type = "text/plain" + +[project.urls] +Homepage = "http://markkness.net/colorpy/" +"Source Code" = "https://github.com/fish2000/colorpy" +"Issue Tracker" = "https://github.com/fish2000/colorpy/issues" + +[tool.setuptools] +package-dir = {colorpy = "."} +packages = ["colorpy"] +include-package-data = false + +[tool.setuptools.package-data] +colorpy = [ + "README.rst", + "COPYING.txt", + "COPYING.LESSER.txt", + "license.txt", + "ColorPy.html", +] diff --git a/setup.py b/setup.py deleted file mode 100755 index 38cdc3a..0000000 --- a/setup.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python -''' -setup.py - Setup script to install the ColorPy package. - -To install the ColorPy package: -From the directory in which the ColorPy distribution was unpacked, run: - -python setup.py install - -You should now be able to say 'import colorpy' in your programs and use the package. - -Creating the distribution: - -python setup.py sdist --formats=zip -python setup.py sdist --formats=gztar -python setup.py bdist_wininst -''' - -from distutils.core import setup - -data_files = [ - 'README.rst', - 'COPYING.txt', - 'COPYING.LESSER.txt', - 'license.txt', - 'ColorPy.html', -] - -long_description = ''' -ColorPy is a Python package to convert physical descriptions of light - - spectra of light intensity vs. wavelength - into RGB colors that can - be drawn on a computer screen. - It provides a nice set of attractive plots that you can make of such - spectra, and some other color related functions as well. -''' - -setup ( - name='colorpy', - version='0.1.1', - description='Color calculations with physical descriptions of light spectra', - long_description=long_description, - author='Mark Kness', - author_email='mkness@alumni.utexas.net', - url='http://markkness.net/colorpy/', - license='GNU Lesser GPL Version 3', - package_dir={'colorpy': '.'}, - packages=['colorpy'], - package_data={'colorpy': data_files}, -) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test.py b/tests/__main__.py similarity index 97% rename from test.py rename to tests/__main__.py index b4fc98c..8b374f3 100755 --- a/test.py +++ b/tests/__main__.py @@ -40,5 +40,6 @@ def test (): test_blackbody.test() test_rayleigh.test() test_thinfilm.test() - - + +if __name__ == "__main__": + test() diff --git a/test_blackbody.py b/tests/test_blackbody.py similarity index 99% rename from test_blackbody.py rename to tests/test_blackbody.py index a7bb481..07e7076 100755 --- a/test_blackbody.py +++ b/tests/test_blackbody.py @@ -26,7 +26,7 @@ import math, random, numpy -from . import colormodels, blackbody +from colorpy import colormodels, blackbody STEFAN_BOLTZMAN = 5.670e-8 # W/(m^2 K^4) diff --git a/test_ciexyz.py b/tests/test_ciexyz.py similarity index 98% rename from test_ciexyz.py rename to tests/test_ciexyz.py index d886943..2ca1c13 100755 --- a/test_ciexyz.py +++ b/tests/test_ciexyz.py @@ -26,7 +26,7 @@ import random -from . import ciexyz +from colorpy import ciexyz def test (verbose=0): '''Test the CIE XYZ conversions. Mainly call some functions.''' diff --git a/test_colormodels.py b/tests/test_colormodels.py similarity index 99% rename from test_colormodels.py rename to tests/test_colormodels.py index 9365012..84604bf 100755 --- a/test_colormodels.py +++ b/tests/test_colormodels.py @@ -25,7 +25,7 @@ from __future__ import division, absolute_import, print_function import math, random, numpy -from . import colormodels, ciexyz +from colorpy import colormodels, ciexyz def test_xyz_rgb (verbose=1): '''Test that xyz_to_rgb() and rgb_to_xyz() are inverses.''' diff --git a/test_illuminants.py b/tests/test_illuminants.py similarity index 98% rename from test_illuminants.py rename to tests/test_illuminants.py index 2543d9b..36f8f7b 100755 --- a/test_illuminants.py +++ b/tests/test_illuminants.py @@ -24,7 +24,7 @@ ''' from __future__ import division, absolute_import, print_function -from . import illuminants +from colorpy import illuminants def test (verbose=0): '''Mainly call some functions.''' diff --git a/test_rayleigh.py b/tests/test_rayleigh.py similarity index 96% rename from test_rayleigh.py rename to tests/test_rayleigh.py index 6ade594..03295fe 100755 --- a/test_rayleigh.py +++ b/tests/test_rayleigh.py @@ -26,7 +26,7 @@ import random -from . import rayleigh, illuminants +from colorpy import rayleigh, illuminants def test (): '''Mainly call some functions.''' diff --git a/test_thinfilm.py b/tests/test_thinfilm.py similarity index 97% rename from test_thinfilm.py rename to tests/test_thinfilm.py index 3142769..f824953 100755 --- a/test_thinfilm.py +++ b/tests/test_thinfilm.py @@ -26,7 +26,7 @@ import random -from . import illuminants, thinfilm +from colorpy import illuminants, thinfilm def test (): '''Module test. Mainly call some functions.'''