doug-101 / ConvertAll-py

a flexible unit converter
http://convertall.bellz.org
39 stars 15 forks source link

App does not work with PYTHONSAFEPATH=y #25

Open hydrargyrum opened 12 months ago

hydrargyrum commented 12 months ago

All source files are in the source repository, without even a __init__.py so nothing is namespaced, e.g. import numedit instead of import convertall.numedit. This prevents from running the app with PYTHONSAFEPATH=y env var set (which is a good security practice), and may pollute the global module namespace (instead of exposing just a global convertall package with submodules, it exposes ~30 global modules with somewhat generic names like cmdline (instead of convertall.cmdline which would be reasonable). I believe it may also hinder packaging tentatives like https://github.com/doug-101/ConvertAll/issues/24 The correct thing to do would be to put all source files in a convertall dir, and fix imports by using either absolute imports import convertall.numedit / from convertall import numedit or relative imports from . import numedit.