python-toolbox-przemek 0.1.1__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-toolbox-przemek
3
- Version: 0.1.1
3
+ Version: 0.3.0
4
4
  Summary: We want to provide basic tools for our day-to-day work.
5
5
  Author: przemek@sagalo.pro
6
6
  Requires-Python: <4,>=3.11
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-toolbox-przemek"
3
- version = "0.1.1"
3
+ version = "0.3.0"
4
4
  description = "We want to provide basic tools for our day-to-day work."
5
5
  authors = [
6
6
  {name = "przemek@sagalo.pro"}
@@ -19,7 +19,9 @@ debug = [ "debugpy==1.8.14" ]
19
19
  lint = [ "black==24.2.0", "isort==5.13.2", "nbqa==1.9.1" ]
20
20
  notebook = [ "nbstripout==0.8.1", "jupytext==1.17.0", "ipykernel==6.29.5" ]
21
21
  tests = [ "coverage==7.8.2" ]
22
-
22
+
23
+ [project.scripts]
24
+ ppce = "python_toolbox_przemek.toolbox_venv:create_venv_unix_like"
23
25
 
24
26
  [build-system]
25
27
  requires = ["setuptools >= 79.0.1"]
@@ -0,0 +1,24 @@
1
+ import venv
2
+ import os
3
+
4
+ def create_venv_unix_like(env_name="venv"):
5
+ """
6
+ Creates a Python virtual environment with the same behavior as
7
+ 'python -m venv <env_name>' on Unix-like systems (Linux/macOS).
8
+ It ensures pip is installed and uses symbolic links.
9
+ If the environment already exists, it skips creation.
10
+ """
11
+ env_path = os.path.join(os.getcwd(), env_name)
12
+
13
+ if os.path.exists(env_path):
14
+ print(f"Environment '{env_name}' already exists at {env_path}. Skipping creation.")
15
+ else:
16
+ print(f"Creating virtual environment '{env_name}' at {env_path}...")
17
+ try:
18
+ # with_pip=True: Ensures pip (and setuptools/wheel) are installed.
19
+ # symlinks=True: Uses symbolic links for efficiency (default on non-Windows).
20
+ builder = venv.EnvBuilder(with_pip=True, symlinks=True)
21
+ builder.create(env_path)
22
+ print(f"Environment '{env_name}' created successfully.")
23
+ except Exception as e:
24
+ print(f"Error creating environment: {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-toolbox-przemek
3
- Version: 0.1.1
3
+ Version: 0.3.0
4
4
  Summary: We want to provide basic tools for our day-to-day work.
5
5
  Author: przemek@sagalo.pro
6
6
  Requires-Python: <4,>=3.11
@@ -1,8 +1,10 @@
1
1
  README.md
2
2
  pyproject.toml
3
3
  src/python_toolbox_przemek/__init__.py
4
+ src/python_toolbox_przemek/toolbox_venv.py
4
5
  src/python_toolbox_przemek.egg-info/PKG-INFO
5
6
  src/python_toolbox_przemek.egg-info/SOURCES.txt
6
7
  src/python_toolbox_przemek.egg-info/dependency_links.txt
8
+ src/python_toolbox_przemek.egg-info/entry_points.txt
7
9
  src/python_toolbox_przemek.egg-info/requires.txt
8
10
  src/python_toolbox_przemek.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ ppce = python_toolbox_przemek.toolbox_venv:create_venv_unix_like