From ecd6aa920a6287905e86e3c98cbe6bacc6e8677c Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Sat, 30 Jan 2021 17:33:57 -0500 Subject: [PATCH] Add setup.py, and make into actual Python module --- Makefile | 19 ------------------- README.md | 3 +++ lightcards/__init__.py | 3 +++ {src => lightcards}/display.py | 0 {src => lightcards}/lightcards.py | 3 +-- {src => lightcards}/parse.py | 0 requirements.txt | 2 -- setup.py | 21 +++++++++++++++++++++ 8 files changed, 28 insertions(+), 23 deletions(-) delete mode 100644 Makefile create mode 100644 lightcards/__init__.py rename {src => lightcards}/display.py (100%) rename {src => lightcards}/lightcards.py (95%) rename {src => lightcards}/parse.py (100%) delete mode 100644 requirements.txt create mode 100644 setup.py diff --git a/Makefile b/Makefile deleted file mode 100644 index b6b6727..0000000 --- a/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -.DEFAULT_GOAL := install - -prep: - mkdir -p /usr/local/bin - mkdir -p /usr/local/man/man1 - -install: - make prep - mkdir -p /usr/local/share/lightcards/ - cp lightcards.py /usr/local/bin/lightcards - cp man/lightcards.1 /usr/local/man/man1/ - -uninstall: - rm /usr/local/bin/lightcards - rm /usr/local/man/man1/lightcards.1 - -reinstall: - make uninstall - make install diff --git a/README.md b/README.md index 3db73a2..ffc1aa1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # lightcards Lightcards is a terminal program for using flashcards from a Markdown or HTML table. It is currently under heavy development, and unusable for productive studying. +# Installation +`pip install .` + ## License Copyright Armaan Bhojwani 2021, MIT license diff --git a/lightcards/__init__.py b/lightcards/__init__.py new file mode 100644 index 0000000..b460a51 --- /dev/null +++ b/lightcards/__init__.py @@ -0,0 +1,3 @@ +from . import lightcards + +lightcards.main() diff --git a/src/display.py b/lightcards/display.py similarity index 100% rename from src/display.py rename to lightcards/display.py diff --git a/src/lightcards.py b/lightcards/lightcards.py similarity index 95% rename from src/lightcards.py rename to lightcards/lightcards.py index 88ac6e9..c744f3a 100755 --- a/src/lightcards.py +++ b/lightcards/lightcards.py @@ -5,8 +5,7 @@ import argparse from curses import wrapper -import display -import parse +from . import display, parse def parse_args(): diff --git a/src/parse.py b/lightcards/parse.py similarity index 100% rename from src/parse.py rename to lightcards/parse.py diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 2fc693c..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -beautifulsoup4==4.9.3 -markdown==3.3.3 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6b7eb99 --- /dev/null +++ b/setup.py @@ -0,0 +1,21 @@ +from setuptools import setup + +setup( + name="lightcards", + version="0.0.0", + description="Markdown flashcards", + url="https://sr.ht/~armaan/lightcards", + author="Armaan Bhojwani", + author_email="me@armaanb.net", + license="MIT", + packages=["lightcards"], + install_requires=["beautifulsoup4", "markdown"], + classifiers=[ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Other Audience", + "Environment :: Console :: Curses", + "License :: OSI Approved :: MIT License", + "Topic :: Utilities" + ], +) + -- 2.39.2