From 36a2af47e2e66d15e2e665d83600afe423c9942f Mon Sep 17 00:00:00 2001 From: Andrei Batomunkuev Date: Sat, 27 Nov 2021 02:50:19 -0500 Subject: [PATCH] Update: - Updated source code - Updated unit-tests - Updated .gitignore - Added packaging - Updated README --- .DS_Store | Bin 8196 -> 8196 bytes .gitignore | 5 ++++- README.md | 15 ++++++++------- fast_ssg/__main__.py | 1 + fast_ssg/utils.py | 2 +- pyproject.toml | 7 +++++++ setup.cfg | 25 +++++++++++++++++++++++++ setup.py | 3 +++ tests/utils_test.py | 8 ++++---- 9 files changed, 53 insertions(+), 13 deletions(-) create mode 100644 pyproject.toml create mode 100644 setup.cfg create mode 100644 setup.py diff --git a/.DS_Store b/.DS_Store index 6943690965ab4e2b80e0e33ddc5e208ac331cd5e..6903b54b0a116b9b87a9d9b40186c388cd177782 100644 GIT binary patch delta 31 mcmZp1XmQvOBFxFbkj9Y6P|Q%WIZ;@Tk(rT!WpkfM88-le)(4XS delta 31 mcmZp1XmQvOBFxLhkj9Y6P|Q%mkjhZBIaXMYadW>&DK`Lzwg_YZ diff --git a/.gitignore b/.gitignore index 151ce9f..c479142 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ dist/ __pycache__/ -.coverage \ No newline at end of file +.coverage +*.egg +*.egg-info +build/ \ No newline at end of file diff --git a/README.md b/README.md index b14a3bf..7dcc426 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Fast Static Site Generator (Fast SSG) - a tool for generating a complete HTML fi ## Tool installation To install the tool run the following command ``` -pip3 install -r requirements.txt +pip install fast-ssg==1.0.0 ``` ## Tool features @@ -27,11 +27,11 @@ pip3 install -r requirements.txt ## Usage with shorthand flags | Description | Command | | ------------ | -------- | -|Generate basic HTML file(s)|`python3 fast_ssg --input "relative path or absolute path to the file or folder"`| -|Generate basic HTML file(s) with CSS stylesheet | `python3 fast_ssg --input "relative path or absolute path to the file or folder" --stylesheet "URL to CSS stylesheet"`| -|New Feature: Support arguments passed with Config File | `python3 fast_ssg -c ./ssg-config.json` | -|Help | `python3 fast_ssg --help` | -|Get current version | `python3 fast_ssg --version`| +|Generate basic HTML file(s)|`fast_ssg --input "relative path or absolute path to the file or folder"`| +|Generate basic HTML file(s) with CSS stylesheet | `fast_ssg --input "relative path or absolute path to the file or folder" --stylesheet "URL to CSS stylesheet"`| +|New Feature: Support arguments passed with Config File | `fast_ssg -c ./ssg-config.json` | +|Help | `fast_ssg --help` | +|Get current version | `fast_ssg --version`| ## Shorthand flags | Flag | Shorthand version | @@ -84,6 +84,7 @@ pip3 install -r requirements.txt |Code | `Code`| |Horizontal rule | `
`| -# Live version +# Live version & Project-package website https://abatomunkuev.github.io/static_site_generator/ +https://pypi.org/project/fast-ssg/1.0.0/ diff --git a/fast_ssg/__main__.py b/fast_ssg/__main__.py index 313c3e3..e5a351a 100644 --- a/fast_ssg/__main__.py +++ b/fast_ssg/__main__.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python import os import shutil from text import OUTPUT_DIR, TextFile diff --git a/fast_ssg/utils.py b/fast_ssg/utils.py index 722999c..883b34d 100644 --- a/fast_ssg/utils.py +++ b/fast_ssg/utils.py @@ -121,7 +121,7 @@ def cla_parser(): "-v", "--version", action="version", - version="Fast Static Site Generator 0.1", + version="Fast Static Site Generator 1.0.0", help="show program's version number and exit", ) # --stylesheet -s argument diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..17f0cd5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel", + "beautifulsoup4==4.10.0" +] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..78b87a1 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,25 @@ +[metadata] +name = fast_ssg +version = 1.0.0 +author = Andrei Batomunkuev +author_email = andreibatomunkuev@gmail.com +description = Fast Static Site Generator - a tool for generating a complete HTML files from raw data like txt and markdown files. +long_description = file: README.md +long_description_content_type = text/markdown +url = https://github.com/abatomunkuev/static_site_generator +project_urls = + Bug Tracker = https://github.com/abatomunkuev/static_site_generator/issues +classifiers = + Programming Language :: Python :: 3 + License :: OSI Approved :: MIT License + Operating System :: OS Independent + +[options] +package_dir = +packages = fast_ssg +python_requires = >=3.6 +install_requires = + beautifulsoup4 == 4.10.0 +[options.entry_points] +console_scripts = + fast_ssg = fast_ssg.__main__:main \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6068493 --- /dev/null +++ b/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup + +setup() diff --git a/tests/utils_test.py b/tests/utils_test.py index 19f2a55..cc4e120 100644 --- a/tests/utils_test.py +++ b/tests/utils_test.py @@ -61,16 +61,16 @@ def test_cla_parser_version_arg(self): ) assert ( shortcut_version_output.decode("utf-8") - == "Fast Static Site Generator 0.1\n" - ), 'Should output "Static Site Generator 0.1"' + == "Fast Static Site Generator 1.0.0\n" + ), 'Should output "Fast Static Site Generator 1.0.0"' # Check full argument --version full_version_output = subprocess.check_output( "python3 -c 'from fast_ssg.utils import cla_parser; cla_parser()' --version", shell=True, ) assert ( - full_version_output.decode("utf-8") == "Fast Static Site Generator 0.1\n" - ), 'Should output "Static Site Generator 0.1"' + full_version_output.decode("utf-8") == "Fast Static Site Generator 1.0.0\n" + ), 'Should output "Fast Static Site Generator 1.0.0"' def test_cla_parser_invalid_input_arg(self): """