From e0c003111ae4af3fa62e4c8b6de688883ad40565 Mon Sep 17 00:00:00 2001 From: William Dye Date: Fri, 15 Sep 2023 15:13:57 -0400 Subject: [PATCH] Switch to pyproject.toml; bump version to 1.0.1 --- LICENSE | 19 +++++++++++++++++++ Makefile | 5 ----- README.md | 34 ++++++++++++---------------------- pyproject.toml | 31 +++++++++++++++++++++++++++++++ setup.py | 22 ---------------------- test_requirements.txt | 1 - 6 files changed, 62 insertions(+), 50 deletions(-) create mode 100644 LICENSE delete mode 100644 Makefile create mode 100644 pyproject.toml delete mode 100644 setup.py delete mode 100644 test_requirements.txt diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f3fd10c --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright 2023 William Dye + +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. diff --git a/Makefile b/Makefile deleted file mode 100644 index 7c0f905..0000000 --- a/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -clean: - pip uninstall -y sudoku - -install: clean - pip install . diff --git a/README.md b/README.md index f6adb28..c9dbc92 100644 --- a/README.md +++ b/README.md @@ -5,33 +5,23 @@ using a variety of different algorithms. ## Installation -The package is not currently available on PyPI or any other Python package repository. The easiest -way to install it is to clone the GitHub repository and install it from source. +The easiest way to install the package is to download it from [PyPI](https://pypi.org) using `pip`. +Note that `sudoku` depends on [Python](https://www.python.org/downloads/) 3.7 or newer; please +ensure that you have a semi-recent version of Python installed before proceeding. -### Prerequisites - -* [Python 3.7](https://www.python.org/downloads/release/python-370/) -* [Git](https://git-scm.com) -* [Make](https://www.gnu.org/software/make/) -* [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/) - -### Installation Instructions - -Run the following commands in a shell (a UNIX-like environment is assumed): +Run the following command in a shell (a UNIX-like environment is assumed): ``` -$ git clone git@github.com:will2dye4/sudoku.git -$ cd sudoku -$ mkvirtualenv -p`which python3.7` sudoku -(sudoku) $ make install +$ pip install sudoku ``` -It is not strictly necessary to create a virtual environment for the sudoku package. However, the -package makes use of Python 3.7 features, so if you choose not to use a virtual environment, you -assume responsibility for installing the package in an appropriate Python 3.7 environment. +The package does not have any dependencies besides Python itself. If you wish to sandbox your +installation inside a virtual environment, you may choose to use +[virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/) or a similar +utility to do so. -When successfully installed, a program called `sudoku` will be placed on your `PATH`. See the Usage -section below for details about how to use this program. +When successfully installed, a program called `sudoku` will be placed on your `PATH`. See the +Usage section below for details about how to use this program. ## Usage @@ -275,4 +265,4 @@ this reason, **GUI mode is not available when using the DLX algorithm**. A sample of the program running in GUI mode is shown below. -![GUI Mode](./images/gui_mode.png) +![GUI Mode](https://raw.githubusercontent.com/will2dye4/sudoku/master/images/gui_mode.png) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2688be7 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +[build-system] +requires = ['setuptools'] +build-backend = 'setuptools.build_meta' + +[project] +name = 'sudoku' +version = '1.0.1' +description = 'Solve sudoku puzzles using various algorithms' +license = {file = 'LICENSE'} +readme = 'README.md' +authors = [ + {name = 'William Dye'}, +] +keywords = ['dancing links', 'dlx', 'sudoku', 'sudoku solver'] +requires-python = '>=3.7' + +[project.optional-dependencies] +test = [ + 'pytest ~= 3.7.2', +] + +[project.scripts] +ku = 'sudoku.__main__:ku' +sudoku = 'sudoku.__main__:main' + +[project.urls] +Repository = 'https://github.com/will2dye4/sudoku.git' + +[tool.setuptools.packages.find] +include = ['sudoku*'] +namespaces = false diff --git a/setup.py b/setup.py deleted file mode 100644 index e04dca8..0000000 --- a/setup.py +++ /dev/null @@ -1,22 +0,0 @@ -from setuptools import ( - find_packages, - setup, -) - - -with open('test_requirements.txt') as f: - test_requirements = f.readlines() - - -setup( - name='sudoku', - version='1.0.0', - packages=find_packages(), - test_requires=test_requirements, - entry_points={ - 'console_scripts': [ - 'ku = sudoku.__main__:ku', - 'sudoku = sudoku.__main__:main', - ] - } -) diff --git a/test_requirements.txt b/test_requirements.txt deleted file mode 100644 index 0986fc0..0000000 --- a/test_requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pytest==3.7.2