mirror of
https://github.com/rpm-software-management/tito.git
synced 2025-02-23 04:02:46 +00:00
Modernize developer installation
Support the popular pip editable installation mode. To work-around a problem in setuptools' develop target, generalize 'install_dir' to say all packages are in 'src' (for more info, see: https://github.com/pypa/pip/issues/126). Remove pre-generated bin/tito-dev script.
This commit is contained in:
parent
46bc5ab1a1
commit
6f5a455aac
4 changed files with 12 additions and 42 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -25,3 +25,4 @@ include
|
|||
lib
|
||||
local
|
||||
hacking/*/tito.spec
|
||||
tito-venv/
|
||||
|
|
11
HACKING
11
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
|
||||
|
|
39
bin/tito-dev
39
bin/tito-dev
|
@ -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:])
|
3
setup.py
3
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,
|
||||
|
|
Loading…
Add table
Reference in a new issue