Skip to content

Commit

Permalink
Update doctools directory for manage_requirements again
Browse files Browse the repository at this point in the history
Bound setuptools_scm to 8 minimum
Updated rapidjson
Remove references to setup.cfg from test plugin
Use same environment variables for julia status as were used for installation
  • Loading branch information
langmm committed Feb 5, 2024
1 parent c1645ee commit e161c9f
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 20 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
requires = [
"scikit-build-core",
"setuptools_scm",
"setuptools_scm>=8",
"hatch-fancy-pypi-readme",
"numpy",
]
Expand Down
4 changes: 2 additions & 2 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ requirements:
- numpy >=1.13.0
- python # [build_platform != target_platform]
- scikit-build-core
- setuptools_scm
- setuptools_scm >=8
- {{ compiler('c') }}
- {{ compiler('cxx') }}
host:
Expand All @@ -60,7 +60,7 @@ requirements:
- pip
- python
- scikit-build-core
- setuptools_scm
- setuptools_scm >=8
- sysv_ipc # [not win]
run:
- GitPython
Expand Down
20 changes: 10 additions & 10 deletions utils/requirements/requirements.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@
"method": "conda"
}
},
{
"hatch-fancy-pypi-readme": {
"host": true,
"flags": {
"build": true,
"build_only": true
}
}
},
{
"matplotlib": {
"flags": {
Expand Down Expand Up @@ -94,15 +103,6 @@
"pyyaml",
"pyzmq",
"requests",
{
"hatch-fancy-pypi-readme": {
"host": true,
"flags": {
"build": true,
"build_only": true
}
}
},
{
"scikit-build-core": {
"host": true,
Expand All @@ -120,7 +120,7 @@
}
},
{
"setuptools_scm": {
"setuptools_scm>=8": {
"host": true,
"flags": {
"build": true,
Expand Down
2 changes: 1 addition & 1 deletion utils/requirements/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ general:
- scipy:
flags:
method_in_setup: conda
- setuptools_scm:
- setuptools_scm>=8:
host: True
flags:
build: True
Expand Down
3 changes: 2 additions & 1 deletion yggdrasil/doctools.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,8 @@ def write_package_extras_table(**kwargs):
"""
from yggdrasil import tools
utils_dir = os.path.join(os.getcwd(), 'utils')
utils_dir = os.path.join(
os.path.dirname(os.path.dirname(os.getcwd())), 'utils')
print(f"utils_dir = {utils_dir}")
try:
sys.path.insert(0, utils_dir)
Expand Down
16 changes: 16 additions & 0 deletions yggdrasil/drivers/JuliaModelDriver.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from yggdrasil import platform
from yggdrasil.drivers.InterpretedModelDriver import InterpretedModelDriver
from yggdrasil.drivers.PythonModelDriver import PythonModelDriver
import shutil
import os


class JuliaModelDriver(InterpretedModelDriver): # pragma: Julia
Expand Down Expand Up @@ -126,6 +128,20 @@ def set_env_class(cls, **kwargs):
"""
out = super(JuliaModelDriver, cls).set_env_class(**kwargs)
out['PYTHON'] = PythonModelDriver.get_interpreter()
julia_exe = shutil.which('julia')
if ((julia_exe and out.get('CONDA_PREFIX', None)
and julia_exe.startswith(out['CONDA_PREFIX'])
and not out.get('JULIA_DEPOT_PATH', None))):
out['JULIA_DEPOT_PATH'] = os.pathsep.join(
[os.path.join(out['CONDA_PREFIX'], 'share', 'julia'), ''])
out['JULIA_PROJECT'] = (
f"@{os.path.basename(out['CONDA_PREFIX'])}")
out['JULIA_LOAD_PATH'] = os.pathsep.join(
["@", out['JULIA_PROJECT'], "@stdlib"])
out['CONDA_JL_HOME'] = out['CONDA_PREFIX']
out['CONDA_JL_CONDA_EXE'] = out['CONDA_EXE']
out['JULIA_SSL_CA_ROOTS_PATH'] = os.path.join(
out['CONDA_PREFIX'], 'ssl', 'cacert.pem')
return out

@classmethod
Expand Down
6 changes: 3 additions & 3 deletions yggdrasil/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ def setup_ci(args):
args += ['-v',
'--import-mode=importlib',
f'--cov={package_dir}',
'-c', 'setup.cfg',
'-c', 'pyproject.toml',
'--cov-config=.coveragerc',
'--ignore=yggdrasil/rapidjson/']
# f'--rootdir={package_dir}']
# if not any(x.startswith('--with-mpi') for x in args):
# args += ['--reruns=2', '--reruns-delay=1', '--timeout=900']
# Additional checks
if not os.path.isfile('setup.cfg'):
if not os.path.isfile('pyproject.toml'):
raise RuntimeError("The CI tests must be run from the root "
"directory of the yggdrasil git repository.")
src_cmd = ('python -c \"import versioneer; '
Expand All @@ -145,7 +145,7 @@ def setup_ci(args):
"\tBuild version: %s\n")
% (src_ver, dst_ver))
subprocess.check_call(
["flake8", "yggdrasil", "--append-config", "setup.cfg"])
["flake8", "yggdrasil"]) # , "--append-config", "setup.cfg"])
if not os.path.isfile(".coveragerc"):
raise RuntimeError(".coveragerc file dosn't exist.")
with open(".coveragerc", "r") as fd:
Expand Down
2 changes: 1 addition & 1 deletion yggdrasil/python-rapidjson
Submodule python-rapidjson updated 1 files
+1 −1 rapidjson
2 changes: 1 addition & 1 deletion yggdrasil/rapidjson

0 comments on commit e161c9f

Please sign in to comment.