Skip to content

[WIP] install Python requirements #3295

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

Closed
wants to merge 3 commits into from
Closed
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
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ jobs:
before_install: dev/before_install
before_script: dev/before
- stage: test
name: macOS + Oracle JDK 8
name: macOS + Oracle JDK 11
os: osx
osx_image: xcode8.3
osx_image: xcode10.1
jdk: oraclejdk11
install: true
script: dev/main
before_install: dev/before_install
Expand Down
2 changes: 2 additions & 0 deletions opengrok-tools/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
include README-dist.txt
include requirements.txt
include requirements-tests.txt
39 changes: 38 additions & 1 deletion opengrok-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ Portions Copyright (c) 2017-2018, 2020, Chris Fraire <cfraire@me.com>.
<includes>
<include>MANIFEST.in</include>
<include>README-dist.txt</include>
<include>requirements.txt</include>
<include>requirements-tests.txt</include>
<include>setup.py</include>
<include>setup.cfg</include>
</includes>
Expand Down Expand Up @@ -213,7 +215,6 @@ Portions Copyright (c) 2017-2018, 2020, Chris Fraire <cfraire@me.com>.
<argument>--upgrade</argument>
<argument>pip</argument>
<argument>setuptools</argument>
<argument>certifi</argument>
<argument>wheel</argument>
</arguments>
</configuration>
Expand All @@ -222,6 +223,42 @@ Portions Copyright (c) 2017-2018, 2020, Chris Fraire <cfraire@me.com>.
<goal>exec</goal>
</goals>
</execution>
<execution>
<id>Install requirements via pip</id>
<configuration>
<executable>${python.environment}/python</executable>
<workingDirectory>${project.build.directory}</workingDirectory>
<arguments>
<argument>-m</argument>
<argument>pip</argument>
<argument>install</argument>
<argument>-r</argument>
<argument>${project.basedir}/requirements.txt</argument>
</arguments>
</configuration>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
<execution>
<id>Install test modules via pip</id>
<configuration>
<executable>${python.environment}/python</executable>
<workingDirectory>${project.build.directory}</workingDirectory>
<arguments>
<argument>-m</argument>
<argument>pip</argument>
<argument>install</argument>
<argument>-r</argument>
<argument>${project.basedir}/requirements-tests.txt</argument>
</arguments>
</configuration>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
<execution>
<id>Generate python package</id>
<goals>
Expand Down
5 changes: 5 additions & 0 deletions opengrok-tools/requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pytest
GitPython
pytest-xdist
mockito
pytest-mockito
18 changes: 5 additions & 13 deletions opengrok-tools/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
certifi==2018.8.24
chardet==3.0.4
filelock==3.0.10
idna==2.7
JsonForm==0.0.2
jsonschema==2.6.0
JsonSir==0.0.2
Python-EasyConfig==0.1.7
PyYAML==3.13
requests==2.20.0
Resource==0.2.1
six==1.11.0
urllib3==1.23
GitPython==3.0.6
pyyaml
requests>=2.20.0
resource
filelock
setuptools>=36.7.2
23 changes: 8 additions & 15 deletions opengrok-tools/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

from setuptools import setup

from src.main.python.opengrok_tools.version import __version__ as version
Expand All @@ -11,6 +12,11 @@ def readme():
return readme.read()


def readlines(file):
with open(os.path.join(SCRIPT_DIR, file), 'r') as file:
return list(map(str.strip, file.readlines()))


setup(
name='opengrok-tools',
version=version,
Expand All @@ -31,25 +37,12 @@ def readme():
description='Tools for managing OpenGrok instance',
long_description=readme(),
python_requires='>=3.4, <4',
install_requires=[
'jsonschema==2.6.0',
'pyyaml',
'requests>=2.20.0',
'resource',
'filelock',
'setuptools>=36.7.2',
],
install_requires=readlines('requirements.txt'),
setup_requires=[
'pytest-runner',
'setuptools>=36.7.2',
],
tests_require=[
'pytest',
'GitPython',
'pytest-xdist',
'mockito',
'pytest-mockito',
],
tests_require=readlines('requirements-tests.txt'),
entry_points={
'console_scripts': [
'opengrok-config-merge=opengrok_tools.config_merge:main',
Expand Down