Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Python virtual environment #55

Merged
merged 4 commits into from
Oct 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ EXTRA_DIST = \


install-exec-local:
PYTHONUSERBASE=$(DESTDIR)$(prefix) $(PYTHON) -m pip install --user $(top_srcdir)
$(PYTHON) -m pip install $(top_srcdir)


.PHONY: coverage-libtests coverage-pytests coverage-html clean-coverage
Expand Down
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ stages:
BASE_IMAGE: "testenv-fedora-34"
centos_8:
BASE_IMAGE: "testenv-centos-8"
centos_7:
BASE_IMAGE: "testenv-centos-7"
steps:
- checkout: self
submodules: "true"
Expand Down
21 changes: 2 additions & 19 deletions docker/pythia-testenv
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,14 @@ ENV TEST_COVERAGE=${TEST_COVERAGE} PYTHON_COVERAGE=${PYTHON_COVERAGE}

LABEL maintainer="Brad Aagaard <baagaard@usgs.gov>"

USER root

# Create 'pythia-tester' user
ENV TEST_USER pythia-tester
RUN useradd --create-home --shell /bin/bash $TEST_USER
ENV INSTALL_DIR=/opt/pythia HOME=/home/$TEST_USER
ENV TOPSRC_DIR=$HOME/src TOPBUILD_DIR=$HOME/build

RUN mkdir ${INSTALL_DIR} \
&& chown ${TEST_USER} ${INSTALL_DIR} \
&& chgrp ${TEST_USER} ${INSTALL_DIR}
ENV PATH $PATH:$INSTALL_DIR/bin
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:$INSTALL_DIR/lib
ENV PYTHONPATH ${PYTHONPATH}:${INSTALL_DIR}/lib/python${PYTHON_VERSION}/site-packages:${INSTALL_DIR}/lib64/python${PYTHON_VERSION}/site-packages

USER $TEST_USER
RUN mkdir -p ${INSTALL_DIR}/lib/python${PYTHON_VERSION}/site-packages && mkdir -p ${INSTALL_DIR}/lib64/python${PYTHON_VERSION}/site-packages

USER ${TEST_USER}

# ------------------------------------------------------------------------------
from setup as configure

ENV src_dir=${TOPSRC_DIR}/pythia build_dir=${TOPBUILD_DIR}/pythia
RUN mkdir -p ${src_dir} && mkdir -p ${build_dir}
COPY --chown=pythia-tester:pythia-tester . ${src_dir}
COPY --chown=pylith-tester:pylith-tester . ${src_dir}

WORKDIR ${src_dir}
RUN autoreconf --install --verbose
Expand Down
2 changes: 1 addition & 1 deletion pythia/pyre/inventory/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def locatorRepr(locator):

def getLocatorContext(dct):
for className in ['FileLocator', 'ScriptLocator', 'SimpleFileLocator', 'SimpleLocator']:
m = __import__('pyre.parsing.locators.' + className, globals(), locals(), [className])
m = __import__('pythia.pyre.parsing.locators.' + className, globals(), locals(), [className])
dct[className] = getattr(m, className)
return

Expand Down