From a83a85a8a9e4ea47df65411d1b27b8acc9a92ac1 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Sat, 1 Mar 2025 09:54:24 -0500 Subject: [PATCH] remarkbox 0.0.11 modified: requirements.py3.txt modified: setup.py --- requirements.py3.txt | 6 ++++-- setup.py | 36 ++++++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/requirements.py3.txt b/requirements.py3.txt index d51cdcf..f6bb2dc 100644 --- a/requirements.py3.txt +++ b/requirements.py3.txt @@ -45,11 +45,13 @@ miniuri # the official Remarkbox "meta" theme. #git+https://github.com/russellballestrini/remarkbox-theme-meta.git#egg-remarkbox-theme-meta -git+https://git.unturf.com/engineering/remarkbox/remarkbox-theme-meta.git#egg-remarkbox-theme-meta +#git+https://git.unturf.com/engineering/remarkbox/remarkbox-theme-meta.git#egg-remarkbox-theme-meta +#remarkbox-theme-meta @ git+https://git.unturf.com/engineering/remarkbox/remarkbox-theme-meta.git # another example theme. #git+https://github.com/russellballestrini/remarkbox-westworld.git#egg-remarkbox-westworld -git+https://git.unturf.com/engineering/remarkbox/remarkbox-westworld.git#egg-remarkbox-westworld +#git+https://git.unturf.com/engineering/remarkbox/remarkbox-westworld.git#egg-remarkbox-westworld +#remarkbox-westworld @ git+https://git.unturf.com/engineering/remarkbox/remarkbox-westworld.git # Create URI slugs from titles. python-slugify diff --git a/setup.py b/setup.py index 2e4c140..2c0d303 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,17 @@ import os from setuptools import setup, find_packages +def is_wsl(): + """ + Detect if we're running under Windows Subsystem for Linux. + Checks if /proc/version exists and contains 'microsoft'. + """ + try: + with open('/proc/version', 'r', encoding='utf-8') as f: + return 'microsoft' in f.read().lower() + except Exception: + return False + def parse_requirements(filename): """ Read and parse a requirements file, ignoring comments and blank lines. @@ -8,24 +19,25 @@ def parse_requirements(filename): req_path = os.path.join(os.path.dirname(__file__), filename) with open(req_path, "r", encoding="utf-8") as f: lines = f.read().splitlines() - return [line.strip() for line in lines if line.strip() and not line.startswith("#")] + reqs = [line.strip() for line in lines if line.strip() and not line.startswith("#")] + return reqs + +# Determine which requirements file to use +requirements_file = "requirements-wsl.txt" if is_wsl() else "requirements.py3.txt" +install_requires = parse_requirements(requirements_file) + +# Optional extras for development, production, and testing. +extras_require = { + 'dev': parse_requirements("requirements-dev.txt"), + 'prod': parse_requirements("requirements-prod.txt"), + 'test': parse_requirements("requirements-test.txt"), +} # Read the long description from README.rst here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, "README.rst"), "r", encoding="utf-8") as f: long_description = f.read() -# Use the Python 3 requirements file by default. -install_requires = parse_requirements("requirements.py3.txt") - -# Extras for development, production, testing, and Windows WSL. -extras_require = { - 'dev': parse_requirements("requirements-dev.txt"), - 'prod': parse_requirements("requirements-prod.txt"), - 'test': parse_requirements("requirements-test.txt"), - 'wsl': parse_requirements("requirements-wsl.txt"), -} - setup( name="remarkbox", version="0.0.11",