Skip to content

Latest commit

 

History

History
85 lines (66 loc) · 2.93 KB

File metadata and controls

85 lines (66 loc) · 2.93 KB

Python Utilities for Windows Command Prompt

This directory contains standalone batch files that provide Python aliases and functions converted from zsh to Windows batch format.

Setup

  1. The _bashrc.cmd file automatically adds this directory to your PATH
  2. All Python aliases are defined using doskey commands
  3. Complex functions are implemented as standalone .bat files

Available Aliases

Basic Python Commands

  • p3python3
  • pythonp3 (alias)
  • pyppython3 -m pip
  • pispip show

Python Install Commands

  • pirpython-install-requirements.bat (install from requirements.txt)
  • pirmpython-install-zowe.bat (install zowe client)
  • pyrpip install -r requirements.txt

Python Environment Commands

  • penvpython-env.bat (environment management)
    • penv - Create/activate local environment
    • penv no - Deactivate environment
    • penv api - Activate api environment

Python Test Commands

  • tppython3 test.py
  • tpapython3 app.py
  • pytpytest -s
  • tpupython-test-unit.bat (pytest -s tests/unit/)
  • tpipython-test-integration.bat (pytest -s tests/integration/)

Usage

After loading _bashrc.cmd, you can use these aliases from any directory:

p3 script.py          # python3 script.py
pyp install package   # python3 -m pip install package
pir                   # install requirements.txt
penv                  # create/activate local environment
penv api              # activate api environment
penv no               # deactivate environment
tp                    # python3 test.py
tpa                   # python3 app.py
pyt                   # pytest -s
pyt tests/test_file.py::TestClass::test_method  # run specific test
tpu                   # pytest -s tests/unit/
tpi                   # pytest -s tests/integration/

Environment Management

The penv function provides flexible Python environment management:

  • No arguments: Creates env/ directory if it doesn't exist and activates the virtual environment
  • no: Deactivates the current virtual environment
  • api: Activates the API environment at ~/znp/api/ (customize this path in python-env.bat)
  • Other arguments: Same as no arguments (creates/activates local environment)

Test Examples

Running specific tests:

pyt tests/unit/test_zowe_core.py::TestZosmfProfileManager::test_autodiscovery_and_base_profile_loading

Running test suites:

tpu    # Run all unit tests
tpi    # Run all integration tests

Files

  • python-env.bat - Python environment management
  • python-install-requirements.bat - Install from requirements.txt
  • python-install-zowe.bat - Install zowe client
  • python-test-unit.bat - Run unit tests
  • python-test-integration.bat - Run integration tests
  • test-python-aliases.bat - Test script to verify setup