From 4d038aceab0577c28c071dabb3e21ed96536c9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lennart=20Frid=C3=A9n?= Date: Thu, 31 Mar 2022 13:04:20 +0200 Subject: [PATCH] Make the package buildable This marks the package as pre-alpha and sets the version to `0.1.0`. --- Makefile | 11 ++++++++++- README.md | 2 ++ setup.cfg | 3 +++ setup.py | 43 +++++++++++++++++++++++++++++++++++++++++++ src/pyby/__init__.py | 2 ++ 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 setup.py diff --git a/Makefile b/Makefile index 8e1524d..191c8a0 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ PYTHON_VERSION ?= 3.8 +dist: clean-dist + python3 setup.py sdist + venv: dev-packages.txt virtualenv venv --python=${PYTHON_VERSION} . venv/bin/activate && pip3 install --upgrade pip && pip3 install -r dev-packages.txt @@ -15,6 +18,12 @@ focus-test: venv @ . venv/bin/activate && flake8 src tests --exclude '#*,~*,.#*' .PHONY: clean -clean: +clean: clean-dist rm -rf venv find . -name "*.pyc" -delete + +.PHONY: clean-dist +clean-dist: + rm -rf build + rm -rf src/python_on_rails.egg-info + rm -rf dist diff --git a/README.md b/README.md index 5ce269e..fb679c3 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ Lecture material for implementing certain Ruby-like behaviours in Python. +**NB:** This is heavily under development and subject to change. Expect breaking changes until the 1.0.0 release. + ## Current Functionality The links in the list of available modules, classes, methods, and functions below link to the corresponding Ruby documentation. diff --git a/setup.cfg b/setup.cfg index 7da1f96..6e59a94 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,5 @@ +[bdist_wheel] +universal = 0 + [flake8] max-line-length = 100 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..5ac4a62 --- /dev/null +++ b/setup.py @@ -0,0 +1,43 @@ +from os import path +from re import search +from setuptools import find_packages, setup + + +HERE = path.abspath(path.dirname(__file__)) + +with open(path.join(HERE, "README.md"), encoding="utf-8") as f: + README = f.read() + +with open(path.join(HERE, "src", "pyby", "__init__.py"), encoding="utf-8") as f: + VERSION = search(r'VERSION = "(\d+\.\d+\.\d+)"', f.read()).group(1) + +setup( + name="pyby", + version=VERSION, + description="A collection of Ruby behaviour ported to Python.", + license="MIT", + author="Lennart Fridén", + author_email="lennart@devl.se", + classifiers=[ + "Development Status :: 2 - Pre-Alpha", + # "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Ruby Modules", + ], + keywords="Ruby Enumerable", + long_description=README, + long_description_content_type="text/markdown", + package_dir={"": "src"}, + packages=find_packages(where="src"), + python_requires="~=3.8", + project_urls={ + "Bug Reports": "https://github.com/DevL/pyby/issues", + "Source": "https://github.com/DevL/pyby", + }, + url="https://github.com/DevL/pyby", +) diff --git a/src/pyby/__init__.py b/src/pyby/__init__.py index cd9a029..9a5072d 100644 --- a/src/pyby/__init__.py +++ b/src/pyby/__init__.py @@ -4,6 +4,8 @@ from .enumerator import Enumerator from .object import respond_to, RObject +VERSION = "0.1.0" + __all__ = [ Enumerable, EnumerableDict,