-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from cedadev/dwest77-cci
Version 2.4.0: Poetrization of dependencies and package installation.
- Loading branch information
Showing
23 changed files
with
781 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Automatic Test | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.10','3.11', '3.12'] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip3 install poetry | ||
poetry install | ||
- name: Run tests | ||
run: poetry run pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
.idea/* | ||
venv/ | ||
data/ | ||
test_code/ | ||
test_code/ | ||
.venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2023-2024, Centre of Environmental Data Analysis Developers, | ||
Scientific and Technical Facilities Council (STFC), | ||
UK Research and Innovation (UKRI). | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this | ||
list of conditions and the following disclaimer in the documentation and/or other | ||
materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors | ||
may be used to endorse or promote products derived from this software without | ||
specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
from .elasticsearch.ceda_elasticsearch_client import CEDAElasticsearchClient | ||
|
||
from .index_tools.base import IndexUpdaterBase | ||
from .index_tools.ceda_client import BulkClient | ||
from .index_tools.ceda_client import BulkClient | ||
|
||
from importlib.metadata import version | ||
__version__ = version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +0,0 @@ | ||
import pkg_resources | ||
__version__ = pkg_resources.require("ceda_elasticsearch_tools")[0].version | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
def pytest_collection_modifyitems(items): | ||
|
||
CLASS_ORDER = [ | ||
"TestConsistency", | ||
# "TestCedaDirsUpdaterDeposit", | ||
# "TestCedaDirsUpdaterMoles", | ||
# "TestCedaFbiUpdaterDeposit", | ||
# "TestIndexUpdaterBase", | ||
# "TestClusterHealth", | ||
# "TestMainAliases", | ||
# "TestEOQueries", | ||
# "TestEFFQueries", | ||
# "TestOpensearchQueries", | ||
# "TestIndexMapping", | ||
# "SpotMappingTestCase", | ||
# "CedaEOQueries", | ||
# "IndexMappings", | ||
] | ||
|
||
sorted_items = items.copy() | ||
# read the class names from default items | ||
class_mapping = {item: item.cls.__name__ for item in items} | ||
|
||
|
||
# Iteratively move tests of each class to the end of the test queue | ||
for class_ in CLASS_ORDER: | ||
sorted_items = [it for it in sorted_items if class_mapping[it] != class_] + [ | ||
it for it in sorted_items if class_mapping[it] == class_ | ||
] | ||
|
||
|
||
items[:] = sorted_items |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
|
||
class TestConsistency: | ||
|
||
def test_index_tools(self): | ||
from ceda_elasticsearch_tools import IndexUpdaterBase, BulkClient, __version__ | ||
from ceda_elasticsearch_tools.index_tools import ( | ||
CedaDirs, | ||
CedaEo, | ||
CedaFbi | ||
) | ||
|
||
assert 1==1, "Importing index tools successful." | ||
|
||
def test_elasticsearch(self): | ||
from ceda_elasticsearch_tools import CEDAElasticsearchClient | ||
from ceda_elasticsearch_tools.elasticsearch.ceda_elasticsearch_client import CA_ROOT | ||
|
||
assert 1==1, "Importing elasticsearch successful." | ||
|
||
def test_core(self): | ||
from ceda_elasticsearch_tools.core.log_reader import ( | ||
SpotMapping, | ||
MD5LogFile, | ||
DepositLog, | ||
) | ||
|
||
from ceda_elasticsearch_tools.core.updater import ( | ||
ElasticsearchQuery, | ||
IndexFilter, | ||
ElasticsearchUpdater | ||
) | ||
|
||
from ceda_elasticsearch_tools.core.utils import ( | ||
get_number_of_submitted_lotus_tasks, | ||
percent, | ||
get_latest_log, | ||
list2file_newlines, | ||
ProgressBar | ||
) | ||
|
||
assert 1==1, "Importing core successful." | ||
|
||
def test_cmdline(self): | ||
|
||
from ceda_elasticsearch_tools.cmdline.ceda_eo.coverage_test import main | ||
from ceda_elasticsearch_tools.cmdline.secondary_scripts.md5 import ( | ||
logger_setup, | ||
file_md5, | ||
main | ||
) | ||
from ceda_elasticsearch_tools.cmdline.secondary_scripts.nla_sync_lotus_task import ( | ||
main, | ||
NLASync | ||
) | ||
|
||
from ceda_elasticsearch_tools.cmdline.secondary_scripts.spot_checker import ( | ||
es_connection, | ||
main, | ||
make_query, | ||
process_list, | ||
get_args, | ||
dir_exists | ||
) | ||
|
||
from ceda_elasticsearch_tools.cmdline.fbs_missing_files import ( | ||
submit_jobs_to_lotus, | ||
generate_summary, | ||
create_missing_list, | ||
nolotus, | ||
main, | ||
) | ||
|
||
from ceda_elasticsearch_tools.cmdline.nla_sync_es import ( | ||
chunk_dict, | ||
chunks, | ||
create_output_dir, | ||
download_data_from_nla, | ||
main, | ||
loading | ||
) | ||
|
||
from ceda_elasticsearch_tools.cmdline.update_md5 import ( | ||
logger_setup, | ||
update_from_logs, | ||
extract_id, | ||
write_page_to_file, | ||
download_files_missing_md5, | ||
calculate_md5s, | ||
main | ||
) | ||
|
||
assert 1==1, "Importing cmdline successful." |
Oops, something went wrong.