diff --git a/.gitignore b/.gitignore index 811f030..b33f56a 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ include lib local hacking/*/tito.spec +tito-venv/ diff --git a/HACKING b/HACKING index 12cec39..b60291a 100644 --- a/HACKING +++ b/HACKING @@ -106,8 +106,15 @@ Then from the root of the project: When developing code for tito there are a couple ways you can test: -"bin/tito-dev" is a script that will run code from the local checkout -rather than what is installed on the system. +First install Tito's dependencies for your architecture, i.e. `x86_64`, like +described in [README's INSTALL section](README.md#INSTALL), under installation +from git's `master` branch. + +Then create a virtual environment and install tito in editable mode: + + python3 -m venv --system-site-packages tito-venv + source tito-venv/bin/activate + pip install -e . And of course, you can always use the installed tito to replace itself with a test build of the latest *committed* code in your diff --git a/bin/tito-dev b/bin/tito-dev deleted file mode 100755 index b405c9c..0000000 --- a/bin/tito-dev +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2008,2009 Red Hat, Inc. -# -# This software is licensed to you under the GNU General Public License, -# version 2 (GPLv2). There is NO WARRANTY for this software, express or -# implied, including the implied warranties of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 -# along with this software; if not, see -# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. -# -# Red Hat trademarks are not licensed under GPLv2. No permission is -# granted to use or replicate Red Hat trademarks that are incorporated -# in this software or its documentation. -# - -""" -A Tito development script to run from source. - -This script should only ever be called from bin/ in a source checkout. -""" - -import sys -import os.path - - -# We know this script is in bin/ -SCRIPT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../")) -SRC_DIR = os.path.normpath(os.path.join(SCRIPT_DIR, "src/")) -SRC_BIN_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "bin/")) - -sys.path.insert(0, SRC_DIR) - -os.environ['TITO_SRC_BIN_DIR'] = SRC_BIN_DIR - -from tito.cli import CLI - -if __name__ == "__main__": - CLI().main(sys.argv[1:]) diff --git a/setup.py b/setup.py index ebccde6..ae5b258 100755 --- a/setup.py +++ b/setup.py @@ -28,8 +28,9 @@ setup( url='http://rm-rf.ca/tito', license='GPLv2+', + # tell distutils packages are under src directory package_dir={ - 'tito': 'src/tito', + '': 'src', }, packages=find_packages('src'), include_package_data=True,