diff --git a/.github/workflows/test-python-2.yml b/.github/workflows/test-python-2.yml index 5c340ce..5799db4 100644 --- a/.github/workflows/test-python-2.yml +++ b/.github/workflows/test-python-2.yml @@ -33,4 +33,4 @@ jobs: - name: Run tests run: | - ./run-tests.sh + pytest tests diff --git a/.github/workflows/test-python-3.yml b/.github/workflows/test-python-3.yml index 3ae06cf..0d41271 100644 --- a/.github/workflows/test-python-3.yml +++ b/.github/workflows/test-python-3.yml @@ -39,4 +39,4 @@ jobs: - name: Run tests run: | - ./run-tests.sh + pytest tests diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..9043398 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,37 @@ +FROM python:3.11.6-slim-bullseye as python3-inspire-utils + +ARG APP_HOME=/inspire_utils +WORKDIR ${APP_HOME} + +COPY . . + + +RUN python -m pip install --upgrade pip +RUN python -m pip install -e .[tests] + +CMD ["/bin/bash"] + +FROM fedora:40 as python2-inspire-utils + +ARG APP_HOME=/inspire_utils +WORKDIR ${APP_HOME} + + +RUN dnf update -y +RUN dnf install -y \ +python2.7 \ +wget \ +libxml2-devel \ +libxslt-devel \ +gcc \ +&& dnf clean all + +RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && \ + python2 get-pip.py && \ + rm get-pip.py + +COPY . . + +RUN python2.7 -m pip install -e .[tests] + +CMD ["/bin/bash"] diff --git a/README.rst b/README.md similarity index 62% rename from README.rst rename to README.md index 8189cd7..f2d2a26 100644 --- a/README.rst +++ b/README.md @@ -1,4 +1,5 @@ -.. + + + + # INSPIRE-Utils +### About +INSPIRE-specific utils. -=============== - INSPIRE-Utils -=============== -About -===== +### Local development -INSPIRE-specific utils. +Local development is done via docker. Notice that the package is available for python 2 and python 3 as such, there are 2 stages in the Dockerfile. + +Here's a quick example on what should be done to test it: +```bash +# building the image python 3 and python 2 +docker build -f Dockerfile.dev --target python3-inspire-utils -t inspire-utils:py3 . +docker build -f Dockerfile.dev --target python2-inspire-utils -t inspire-utils:py2 . + +docker run -it /bin/bash + +# inside the container +pytest tests +``` diff --git a/run-tests.sh b/run-tests.sh deleted file mode 100755 index 073b5e5..0000000 --- a/run-tests.sh +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of INSPIRE. -# Copyright (C) 2014-2024 CERN. -# -# INSPIRE is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# INSPIRE is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with INSPIRE. If not, see . -# -# In applying this license, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization -# or submit itself to any jurisdiction. - -set -e -py.test tests diff --git a/setup.py b/setup.py index 3c9c5d0..bc78e5c 100644 --- a/setup.py +++ b/setup.py @@ -25,18 +25,16 @@ URL = "https://github.com/inspirehep/inspire-utils" -with open("README.rst") as f: +with open("README.md") as f: readme = f.read() install_requires = [ - 'Unidecode~=1.0,>=1.0.22', - 'babel~=2.0,>=2.5.1', + 'Unidecode>=1.2.0,<=1.3.8', + 'babel~=2.0,>=2.9.1', 'lxml~=5.0', - 'nameparser~=0.0,>=0.5.3;python_version <= "2.7"', - 'nameparser~=1.1,>=1.1.3;python_version >= "3.6"', - 'python-dateutil~=2.0,>=2.6.1', - 'six~=1.0,>=1.10.0', - 'urllib3~=1.0,<=1.26.12' + 'nameparser~=1.1,>=1.1.3', + 'python-dateutil~=2.0,>=2.9.0', + 'six~=1.0,>=1.10.0' ] docs_require = []