Skip to content

Commit 1df5838

Browse files
committed
Migrate to modern packaging toolchain
1 parent 7b68e79 commit 1df5838

File tree

8 files changed

+89
-36
lines changed

8 files changed

+89
-36
lines changed

doc/contributing.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Contributing
2+
3+
Install development dependencies:
4+
5+
```
6+
conda env create # or `mamba env create`
7+
```
8+
9+
10+
## Development install
11+
12+
```
13+
pip install -e .
14+
```
15+
16+
17+
## Testing the build
18+
19+
```
20+
rm -rf dist
21+
python -m build
22+
pip install dist/*.whl # or `dist/*.tar.gz`
23+
```

environment.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "viscm"
2+
channels:
3+
- "conda-forge"
4+
- "nodefaults"
5+
dependencies:
6+
- "python ~=3.11"
7+
- "numpy ~=1.24"
8+
- "matplotlib ~=3.7"
9+
- "colorspacious ~=1.1"
10+
- "scipy ~=1.10"
11+
- pip:
12+
- "build ~=0.10"

pyproject.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[project]
2+
name = "viscm"
3+
dynamic = ["version"]
4+
description = "A colormap tool"
5+
readme = "README.rst"
6+
authors = [
7+
{name = "Nathaniel J. Smith", email = "njs@pobox.com"},
8+
{name = "Stefan van der Walt", email = "stefanv@berkeley.edu"},
9+
]
10+
classifiers = [
11+
"Development Status :: 3 - Alpha",
12+
"Intended Audience :: Developers",
13+
"Intended Audience :: Science/Research",
14+
"License :: OSI Approved :: MIT License",
15+
"Programming Language :: Python :: 3",
16+
]
17+
18+
requires-python = "~=3.7"
19+
dependencies = [
20+
"numpy",
21+
"matplotlib",
22+
"colorspacious",
23+
"scipy",
24+
]
25+
26+
[project.urls]
27+
repository = "https://github.com/matplotlib/viscm"
28+
# documentation = "https://viscm.readthedocs.io"
29+
30+
[project.license]
31+
text = "MIT"
32+
files = ["LICENSE"]
33+
34+
[project.scripts]
35+
viscm = "viscm.gui:main"
36+
37+
38+
[build-system]
39+
requires = ["setuptools", "setuptools_scm"]
40+
build-backend = "setuptools.build_meta"
41+
42+
[tool.setuptools]
43+
zip-safe = false
44+
packages = {find = {}}
45+
package-data = {viscm = ["examples/*"]}
46+
47+
48+
# [tool.black]

setup.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

setup.py

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,3 @@
1-
from setuptools import setup, find_packages
2-
import sys
3-
import os.path
1+
from setuptools import setup
42

5-
import numpy as np
6-
7-
# Must be one line or PyPI will cut it off
8-
DESC = ("A colormap tool")
9-
LONG_DESC = open("README.rst").read()
10-
11-
setup(
12-
name="viscm",
13-
version="0.10",
14-
description=DESC,
15-
long_description=LONG_DESC,
16-
author="Nathaniel J. Smith, Stefan van der Walt",
17-
author_email="njs@pobox.com, stefanv@berkeley.edu",
18-
url="https://github.com/matplotlib/viscm",
19-
license="MIT",
20-
classifiers =
21-
[ "Development Status :: 3 - Alpha",
22-
"Intended Audience :: Developers",
23-
"Intended Audience :: Science/Research",
24-
"License :: OSI Approved :: MIT License",
25-
"Programming Language :: Python :: 3",
26-
],
27-
packages=find_packages(),
28-
install_requires=["numpy", "matplotlib", "colorspacious", "scipy"],
29-
package_data={'viscm': ['examples/*']},
30-
)
3+
setup(use_scm_version=True)

viscm/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# This file is part of pycam02ucs
21
# Copyright (C) 2014 Nathaniel Smith <njs@pobox.com>
32
# See file LICENSE.txt for license information.
43

viscm/__main__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
# Copyright (C) 2015 Stefan van der Walt <stefanv@berkeley.edu>
44
# See file LICENSE.txt for license information.
55

6-
import sys
76
from .gui import main
8-
main(sys.argv[1:])
7+
main()

viscm/gui.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,8 +948,9 @@ def load(self, path):
948948
self.name = path
949949

950950

951-
def main(argv):
951+
def main():
952952
import argparse
953+
argv = sys.argv[1:]
953954

954955
# Usage:
955956
# python -m viscm
@@ -1331,4 +1332,4 @@ def loadviewer(self):
13311332

13321333

13331334
if __name__ == "__main__":
1334-
main(sys.argv[1:])
1335+
main()

0 commit comments

Comments
 (0)