Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ jobs:
run: |
sudo apt install libimage-exiftool-perl -y
sudo apt-get install -y netcdf-bin
- name: Install dependencies
- name: Install dependencies and checksit
run: |
python -m pip install --upgrade pip
pip install flake8 black pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi
pip install '.[dev]'
- name: Test with pytest
run: |
export UDUNITS2_XML_PATH=/opt/share/udunits/udunits2.xml
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2020 United Kingdom Research and Innovation
Copyright 2025 United Kingdom Research and Innovation

Authors: Ag Stephens

Expand All @@ -23,4 +23,4 @@ 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.
POSSIBILITY OF SUCH DAMAGE.
15 changes: 14 additions & 1 deletion checksit/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import os
from configparser import ConfigParser
from itertools import chain
import sys

if sys.version_info >= (3, 9):
from importlib.resources import files
else:
from importlib_resources import files as imported_files
def files(package):
return imported_files(package)


PACKAGE_ROOT = files("checksit")

# Global CONFIG used by other packages
_CONFIG = None
Expand All @@ -19,7 +30,8 @@ def get_config(package=None):

def _gather_config_files(package=None):
conf_files = []
_config = os.path.join(os.path.dirname(__file__), "etc", ini_file)
#_config = os.path.join(os.path.dirname(__file__), "etc", ini_file)
_config = os.path.join(str(PACKAGE_ROOT), "etc", ini_file)

if not os.path.isfile(_config):
print(f"[WARN] Cannot load default config file from: {_config}")
Expand Down Expand Up @@ -101,6 +113,7 @@ def _load_config(package=None):
conf = ConfigParser()

conf.read(conf_files)
conf["settings"].update({'basedir': str(PACKAGE_ROOT)})
config = {}

mappers = _get_mappers(conf)
Expand Down
File renamed without changes.
File renamed without changes.
Loading