From a7fbf0b25b93b86cda514ff87364b2390f57d61d Mon Sep 17 00:00:00 2001 From: ncdulo <957976+ncdulo@users.noreply.github.com> Date: Thu, 26 Mar 2020 22:23:20 -0400 Subject: [PATCH 1/6] Include metadata into `setup.py` Add some metadata into `setup.py` in an effort to begin expanding it. I would like to begin pushing towards more proper packaging so let's start that here. Just kind of, going off the docs, and starting to add more parameters into the `setup()` call. Need to read into it a bit deeper, and do some further testing, but the `find_packages()` parameter may have included the `ImportError` but when installing via `pip install .` For now, get some sleep. It's almost Friday. --- setup.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 56c8c82..5b4d1bf 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,24 @@ -from setuptools import setup +import setuptools +with open('README.md', 'r') as fh: + long_description = fh.read() -setup( + +setuptools.setup( name='word_tools', version='0.0.1', + author='ncdulo', + description='Utilities for performing actions on words, or collections of words.', + long_description=long_description, + long_description_content_type='text/markdown', + url='https://github.com/ncdulo/word_tools', + packages=setuptools.find_packages(), # What does this do? + classifiers=[ + 'Programming Language :: Python :: 3', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independant', + ], + python_requires='>=3.6', py_modules=['cli'], install_requires=[ 'requests', From d3307180085849e15f340b3902025d4c72bb1557 Mon Sep 17 00:00:00 2001 From: ncdulo <957976+ncdulo@users.noreply.github.com> Date: Fri, 27 Mar 2020 17:57:26 -0400 Subject: [PATCH 2/6] Preparing for PyPi packaging We cover a decent bit of ground, and progress through this commit. This covers most of the requirements to create a wheel, and upload it to PyPi via twine. Using the test instance of PyPi, I notice an error regarding `bs4` not being found when `pip` attempts to install requirements. I need to look into that further. However, installing via PyPi seems to prevent the 'word_tools not found` ImportError we were previously getting from `pip install .`. That's a plus. Otherwise, breaking this commit down: - Switch import style, only take what we need - Pull README.md into setup() - We figured out what `find_packages()` does - Specify license, keywords - Add more classifiers - Typo: Independant -> Independent --- MANIFEST.in | 2 ++ setup.py | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..92c68c5 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include doc/* +include CODE_OF_CONDUCT.md diff --git a/setup.py b/setup.py index 5b4d1bf..6e64f6f 100644 --- a/setup.py +++ b/setup.py @@ -1,22 +1,31 @@ -import setuptools +from setuptools import setup,find_packages +from os import path -with open('README.md', 'r') as fh: +# Pull the current README +cwd = path.abspath(path.dirname(__file__)) +with open(path.join(cwd, 'README.md'), 'r') as fh: long_description = fh.read() -setuptools.setup( +setup( name='word_tools', + packages=find_packages(), # What does this do? version='0.0.1', author='ncdulo', + license='MIT', description='Utilities for performing actions on words, or collections of words.', long_description=long_description, long_description_content_type='text/markdown', url='https://github.com/ncdulo/word_tools', - packages=setuptools.find_packages(), # What does this do? + keywords='word tools dictionary urbandictionary utility cli module', classifiers=[ + 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independant', + 'Operating System :: OS Independent', ], python_requires='>=3.6', py_modules=['cli'], From a67152e33755f11f75506adf5e2c49dbff76a31f Mon Sep 17 00:00:00 2001 From: ncdulo <957976+ncdulo@users.noreply.github.com> Date: Fri, 27 Mar 2020 18:14:39 -0400 Subject: [PATCH 3/6] Fix requirement: bs4 -> beautifulsoup4 As it turns out, the PyPi name is `beautifulsoup4` -- `bs4` is simply the Python module name. Bit confusing, don't you think? --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6e64f6f..1556dae 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ install_requires=[ 'requests', 'click', - 'bs4', + 'beautifulsoup4', ], entry_points = { 'console_scripts': From 29fc9a00144643c01057bfde8b6e993e6c546217 Mon Sep 17 00:00:00 2001 From: ncdulo <957976+ncdulo@users.noreply.github.com> Date: Fri, 27 Mar 2020 18:41:10 -0400 Subject: [PATCH 4/6] Moar classifiers! That was one hell of a list to go through, but it wasn't *too* bad. Adding in what I feel is a solid set of project classifiers for this package. We'll see how things work out once we are on PuPi, and adjust as need be. --- setup.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 1556dae..4aedb08 100644 --- a/setup.py +++ b/setup.py @@ -20,12 +20,24 @@ keywords='word tools dictionary urbandictionary utility cli module', classifiers=[ 'Development Status :: 3 - Alpha', + 'Environment :: Console', + 'Intended Audience :: Developers', + 'Intended Audience :: End Users/Desktop', + 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Operating System :: POSIX :: Linux' 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', + 'Programming Language :: Python :: 3 :: Only', + 'Topic :: Internet', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: Text Processing', + 'Topic :: Text Processing :: Filters', + 'Topic :: Utilities', ], python_requires='>=3.6', py_modules=['cli'], From f3a0f3c36ffb2a1de0c97e425a7fd4975e35feb7 Mon Sep 17 00:00:00 2001 From: ncdulo <957976+ncdulo@users.noreply.github.com> Date: Fri, 27 Mar 2020 19:50:35 -0400 Subject: [PATCH 5/6] Create `requirements{,_dev}.txt` More intended to use as a reference for all of the packages in a complete development environment for `word_tools`. Pip should be fine to handle installing dependencies through the standard install commands. --- requirements.txt | 11 +++++++++++ requirements_dev.txt | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 requirements.txt create mode 100644 requirements_dev.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0ced01a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,11 @@ +beautifulsoup4==4.8.2 +bs4==0.0.1 +certifi==2019.11.28 +chardet==3.0.4 +click==7.1.1 +idna==2.9 +lxml==4.5.0 +requests==2.23.0 +soupsieve==2.0 +urllib3==1.25.8 +word-tools==0.0.1 diff --git a/requirements_dev.txt b/requirements_dev.txt new file mode 100644 index 0000000..ccdef20 --- /dev/null +++ b/requirements_dev.txt @@ -0,0 +1,35 @@ +attrs==19.3.0 +beautifulsoup4==4.8.2 +bleach==3.1.4 +bs4==0.0.1 +certifi==2019.11.28 +cffi==1.14.0 +chardet==3.0.4 +click==7.1.1 +cryptography==2.8 +docutils==0.16 +idna==2.9 +importlib-metadata==1.5.0 +jeepney==0.4.3 +keyring==21.2.0 +more-itertools==8.2.0 +packaging==20.3 +pkginfo==1.5.0.1 +pluggy==0.13.1 +py==1.8.1 +pycparser==2.20 +Pygments==2.6.1 +pyparsing==2.4.6 +pytest==5.4.1 +readme-renderer==25.0 +requests==2.23.0 +requests-toolbelt==0.9.1 +SecretStorage==3.1.2 +six==1.14.0 +soupsieve==2.0 +tqdm==4.43.0 +twine==3.1.1 +urllib3==1.25.8 +wcwidth==0.1.9 +webencodings==0.5.1 +zipp==3.1.0 From a43bc74572fd3be48700d9515c5b7ced5ae1759e Mon Sep 17 00:00:00 2001 From: ncdulo <957976+ncdulo@users.noreply.github.com> Date: Fri, 27 Mar 2020 19:59:21 -0400 Subject: [PATCH 6/6] Append missing `,` I had missed a comma at the end of an item in our classifiers list. Turns out in that case, the strings concatenate themselves rather than throwing a syntax error. Good to know. Uploaded, then installed from test instance of PyPi sucessfuly. There was an error regarding a specific version mismatch with `soupsieve` but that was able to install manually. The error was simply due to the instance not having the exact version numbers as the main PyPi site. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4aedb08..e5f3214 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', - 'Operating System :: POSIX :: Linux' + 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7',