From e50ec64ac1d488e35fceb0fd50c3a4c12367e963 Mon Sep 17 00:00:00 2001 From: James B Date: Wed, 1 Mar 2023 12:03:35 +0000 Subject: [PATCH 1/4] tests: cove package is tested in library so don't test here --- run_tests.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index 766d2626..f64873f8 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,2 +1 @@ -DJANGO_SETTINGS_MODULE=cove.settings py.test cove --cov --cov-report= $@ DJANGO_SETTINGS_MODULE=cove_iati.settings py.test cove_iati --cov-append --cov $@ From a2d77bbfc652450ef544c1707d62d6370d8127b5 Mon Sep 17 00:00:00 2001 From: James B Date: Wed, 1 Mar 2023 12:04:35 +0000 Subject: [PATCH 2/4] deploy: Now only IATI lives in this repository, we can remove some config --- .github/workflows/test.yml | 6 +++--- README.rst | 4 ++-- docs/lib.md | 6 ++++-- manage.py | 2 +- pytest.ini | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2da3ab6e..32ba1abc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,11 +29,11 @@ jobs: - name: Install Ubuntu Translation Libraries run: sudo apt install gettext - name: Test IATI - run: DJANGO_SETTINGS_MODULE=cove_iati.settings py.test -n 2 cove_iati --cov-append --cov + run: py.test -n 2 cove_iati --cov-append --cov - name: Migrate Database - run: DJANGO_SETTINGS_MODULE=cove_iati.settings python manage.py migrate + run: python manage.py migrate - name: Compile Messages - run: DJANGO_SETTINGS_MODULE=cove_iati.settings python manage.py compilemessages + run: python manage.py compilemessages - name: Report to coveralls env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.rst b/README.rst index 0a26509a..a55785a5 100644 --- a/README.rst +++ b/README.rst @@ -83,7 +83,7 @@ Steps to installation: python3 -m venv .ve source .ve/bin/activate pip install -r requirements_dev.txt - DJANGO_SETTINGS_MODULE={cove_MODULENAME}.settings python manage.py migrate + python manage.py migrate python manage.py compilemessages @@ -98,7 +98,7 @@ Then run the development server: .. code:: bash - DJANGO_SETTINGS_MODULE=cove_iati.settings python manage.py runserver + python manage.py runserver Deployment diff --git a/docs/lib.md b/docs/lib.md index 2d7f4f83..1f32c315 100644 --- a/docs/lib.md +++ b/docs/lib.md @@ -35,6 +35,8 @@ For example, see [Cove for BODS](https://github.com/openownership/cove-bods) or Running a Cove instance in this shared Cove repository ------------------------------------------------------ -Some standards are still run in this shared repository, in packages like `cove_iati`. +The IATI standard is still run in this repository, in the package `cove_iati`. -They use the Lib-Cove-Web and the Lib-Cove libraries mentioned above. +It uses the Lib-Cove-Web and the Lib-Cove libraries mentioned above. + +No new COVE's should be created in this repository - they should have their own repository. diff --git a/manage.py b/manage.py index 163d93d0..19af7ad5 100644 --- a/manage.py +++ b/manage.py @@ -3,7 +3,7 @@ import sys if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cove.settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cove_iati.settings") from django.core.management import execute_from_command_line diff --git a/pytest.ini b/pytest.ini index 25d0d52c..e4fb83dc 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,4 @@ [pytest] -DJANGO_SETTINGS_MODULE=cove.settings +DJANGO_SETTINGS_MODULE=cove_iati.settings DEBUG=True python_files=test*.py From 86457107bf34ce1c2dfaaafbca446f096a2862bf Mon Sep 17 00:00:00 2001 From: James B Date: Wed, 1 Mar 2023 12:12:59 +0000 Subject: [PATCH 3/4] deploy: Now only IATI lives here, merge requirements_iati.txt into usual reqs --- .github/workflows/test.yml | 2 -- README.rst | 16 ++++++++-------- requirements.in | 15 +++++++++++++++ requirements.txt | 24 +++++++++++++++++++++++- requirements_dev.txt | 24 +++++++++++++++++++++++- requirements_iati.txt | 15 --------------- 6 files changed, 69 insertions(+), 27 deletions(-) delete mode 100644 requirements_iati.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 32ba1abc..b8efb8ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,8 +24,6 @@ jobs: - name: Install requirements_dev.txt run: pip install -r requirements_dev.txt - - name: Install requirements_iati.txt - run: pip install -r requirements_iati.txt - name: Install Ubuntu Translation Libraries run: sudo apt install gettext - name: Test IATI diff --git a/README.rst b/README.rst index a55785a5..2eedb63c 100644 --- a/README.rst +++ b/README.rst @@ -76,6 +76,14 @@ Steps to installation: * Compile the translations * Run the development server +The following steps are for Ubuntu but equivalent packages are available for other distros. + +.. code:: bash + + sudo apt-get install build-essential libxml2-dev libxslt1-dev python3-dev + +Run: + .. code:: bash git clone https://github.com/OpenDataServices/cove.git @@ -86,14 +94,6 @@ Steps to installation: python manage.py migrate python manage.py compilemessages - -The following steps are for Ubuntu but equivalent packages are available for other distros. - -.. code:: bash - - sudo apt-get install build-essential libxml2-dev libxslt1-dev python3-dev - pip install -r requirements_iati.txt - Then run the development server: .. code:: bash diff --git a/requirements.in b/requirements.in index aa2348a4..bc28d376 100644 --- a/requirements.in +++ b/requirements.in @@ -22,3 +22,18 @@ bleach xmltodict rangedict openpyxl + +# We have a fork of the bdd-tester repo, in order to add a single commit that +# fixes the previous commit we were using, to work with the new pip resolver. +# +# This means the behaviour with the new pip resolver will be the same as +# what happened with the old resolver (where subsequent requirements were +# silently ignored). +# +# We really shouldn't do any more work on this fork, and should instead update +# to the latest upstream version of bdd-tester, which also fixes this +# requirements issue. +# We've not done this yet because this requires changes to cove, and some +# careful testing, which we currently don't have time to do. +-e git+https://github.com/OpenDataServices/bdd-tester.git@e1a1a578e28222904f3f1567409b068222ec02e6#egg=bdd-tester +-e git+https://github.com/OpenDataServices/iati-utils.git@704fa589ad2d3743d3928dcbeeeb06a5e73f8437#egg=iatiutils diff --git a/requirements.txt b/requirements.txt index d8d49ff3..bf2c52cb 100755 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,10 @@ # # pip-compile requirements.in # +-e git+https://github.com/OpenDataServices/bdd-tester.git@e1a1a578e28222904f3f1567409b068222ec02e6#egg=bdd-tester + # via -r requirements.in +-e git+https://github.com/OpenDataServices/iati-utils.git@704fa589ad2d3743d3928dcbeeeb06a5e73f8437#egg=iatiutils + # via -r requirements.in appdirs==1.4.4 # via requests-cache asgiref==3.5.2 @@ -15,6 +19,8 @@ attrs==22.1.0 # requests-cache backports-datetime-fromisoformat==2.0.0 # via flattentool +behave==1.2.5 + # via bdd-tester bleach==5.0.1 # via -r requirements.in btrees==4.11.3 @@ -33,6 +39,8 @@ cffi==1.15.1 # via persistent charset-normalizer==2.1.1 # via requests +click==8.1.3 + # via iatiutils commonmark==0.9.1 # via -r requirements.in contextlib2==21.6.0 @@ -87,13 +95,22 @@ libcove==0.29.0 libcoveweb==0.25.0 # via -r requirements.in lxml==4.9.2 - # via flattentool + # via + # bdd-tester + # flattentool + # iatiutils odfpy==1.4.1 # via flattentool openpyxl==3.0.10 # via # -r requirements.in # flattentool +parse==1.19.0 + # via + # behave + # parse-type +parse-type==0.6.0 + # via behave persistent==4.9.3 # via # btrees @@ -113,6 +130,8 @@ rangedict==0.1.7 requests==2.28.1 # via # -r requirements.in + # bdd-tester + # iatiutils # libcove # libcoveweb # requests-cache @@ -130,8 +149,11 @@ sentry-sdk==1.12.0 # via -r requirements.in six==1.16.0 # via + # bdd-tester + # behave # bleach # jsonschema + # parse-type # python-dateutil # rfc3339-validator # url-normalize diff --git a/requirements_dev.txt b/requirements_dev.txt index a6660845..93efd5eb 100755 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -4,6 +4,10 @@ # # pip-compile requirements_dev.in # +-e git+https://github.com/OpenDataServices/bdd-tester.git@e1a1a578e28222904f3f1567409b068222ec02e6#egg=bdd-tester + # via -r requirements.in +-e git+https://github.com/OpenDataServices/iati-utils.git@704fa589ad2d3743d3928dcbeeeb06a5e73f8437#egg=iatiutils + # via -r requirements.in alabaster==0.7.12 # via sphinx appdirs==1.4.4 @@ -27,6 +31,8 @@ babel==2.11.0 # via sphinx backports-datetime-fromisoformat==2.0.0 # via flattentool +behave==1.2.5 + # via bdd-tester bleach==5.0.1 # via -r requirements.in btrees==4.11.3 @@ -48,6 +54,8 @@ cffi==1.15.1 # persistent charset-normalizer==2.1.1 # via requests +click==8.1.3 + # via iatiutils commonmark==0.9.1 # via # -r requirements.in @@ -150,7 +158,10 @@ libcoveweb==0.25.0 libsass==0.22.0 # via -r requirements_dev.in lxml==4.9.2 - # via flattentool + # via + # bdd-tester + # flattentool + # iatiutils markupsafe==2.1.1 # via jinja2 mccabe==0.7.0 @@ -167,6 +178,12 @@ packaging==22.0 # via # pytest # sphinx +parse==1.19.0 + # via + # behave + # parse-type +parse-type==0.6.0 + # via behave persistent==4.9.3 # via # btrees @@ -217,7 +234,9 @@ recommonmark==0.7.1 requests==2.28.1 # via # -r requirements.in + # bdd-tester # coveralls + # iatiutils # libcove # libcoveweb # requests-cache @@ -239,8 +258,11 @@ sentry-sdk==1.12.0 # via -r requirements.in six==1.16.0 # via + # bdd-tester + # behave # bleach # jsonschema + # parse-type # python-dateutil # rfc3339-validator # transifex-client diff --git a/requirements_iati.txt b/requirements_iati.txt deleted file mode 100644 index 48650479..00000000 --- a/requirements_iati.txt +++ /dev/null @@ -1,15 +0,0 @@ --r requirements.txt -# We have a fork of the bdd-tester repo, in order to add a single commit that -# fixes the previous commit we were using, to work with the new pip resolver. -# -# This means the behaviour with the new pip resolver will be the same as -# what happened with the old resolver (where subsequent requirements were -# silently ignored). -# -# We really shouldn't do any more work on this fork, and should instead update -# to the latest upstream version of bdd-tester, which also fixes this -# requirements issue. -# We've not done this yet because this requires changes to cove, and some -# careful testing, which we currently don't have time to do. --e git+https://github.com/OpenDataServices/bdd-tester.git@e1a1a578e28222904f3f1567409b068222ec02e6#egg=bdd-tester --e git+https://github.com/OpenDataServices/iati-utils.git@704fa589ad2d3743d3928dcbeeeb06a5e73f8437#egg=iatiutils From 82024fde6e2522a79e8f1ca4c9d998e0446febda Mon Sep 17 00:00:00 2001 From: James B Date: Wed, 1 Mar 2023 12:22:31 +0000 Subject: [PATCH 4/4] misc: requirements files should not be executable --- requirements.txt | 0 requirements_dev.txt | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 requirements.txt mode change 100755 => 100644 requirements_dev.txt diff --git a/requirements.txt b/requirements.txt old mode 100755 new mode 100644 diff --git a/requirements_dev.txt b/requirements_dev.txt old mode 100755 new mode 100644