Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
to align build procedure with pyFAI
  • Loading branch information
kif committed Mar 15, 2024
1 parent 0dfffb8 commit 5108dc4
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 18 deletions.
10 changes: 9 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project('FabIO',
'c', 'cython',
license: 'MIT',
meson_version: '>= 0.60',
version: run_command('src/fabio/_version.py',
version: run_command(['version.py', '--wheel'],
check:true).stdout().strip(),
)

Expand All @@ -13,6 +13,7 @@ if meson.backend() != 'ninja'
endif

cc = meson.get_compiler('c')
cy = meson.get_compiler('cython')
m_dep = cc.find_library('m', required : false)
if m_dep.found()
add_project_link_arguments('-lm', language : 'c')
Expand All @@ -23,4 +24,11 @@ py_mod = import('python')
py = py_mod.find_installation()
py_dep = py.dependency()

py.install_sources([
'version.py',
],
pure: false, # Will be installed next to binaries
subdir: 'fabio' # Folder relative to site-packages to install to
)

subdir('src/fabio')
5 changes: 2 additions & 3 deletions src/fabio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
__contact__ = "Jerome.Kieffer@ESRF.eu"
__license__ = "GPLv3+"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "21/06/2023"
__date__ = "15/03/2024"
__status__ = "stable"

import sys
Expand All @@ -39,8 +39,7 @@
logging.basicConfig()

import os
from ._version import __date__ as date # noqa
from ._version import version, version_info, hexversion, strictversion # noqa
from .version import __date__ as date, version, version_info, hexversion, strictversion # noqa
from . import fabioformats as _fabioformats

# provide a global fabio API
Expand Down
1 change: 0 additions & 1 deletion src/fabio/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ subdir('test')
subdir('utils')

py.install_sources([
'_version.py',
'adscimage.py',
'binaryimage.py',
'bruker100image.py',
Expand Down
6 changes: 3 additions & 3 deletions src/fabio/nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"""

__author__ = "Jerome Kieffer"
__author__ = "Jérôme Kieffer"
__contact__ = "Jerome.Kieffer@ESRF.eu"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "28/04/2021"
__date__ = "15/03/2024"
__status__ = "production"
__docformat__ = 'restructuredtext'

Expand All @@ -44,7 +44,7 @@
import time
import numpy
from .fabioutils import exists
from ._version import version
from .version import version

logger = logging.getLogger(__name__)
try:
Expand Down
13 changes: 7 additions & 6 deletions src/fabio/utils/deprecation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016-2017 European Synchrotron Radiation Facility
# Copyright (c) 2016-2024 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -24,15 +24,16 @@
# ###########################################################################*/
"""Bunch of useful decorators"""

__authors__ = ["Jerome Kieffer", "H. Payno", "P. Knobel"]
__authors__ = ["Jérôme Kieffer", "H. Payno", "P. Knobel"]
__license__ = "MIT"
__date__ = "18/12/2020"
__date__ = "15/03/2024"

import logging
import functools
import traceback
import re
from .. import _version

from ..version import calc_hexversion, hexversion as ref_hexversion

depreclog = logging.getLogger("fabio.DEPRECATION")

Expand All @@ -54,7 +55,7 @@ def hexversion_fromstring(string):
releaselevel = result[3]
if releaselevel is None:
releaselevel = 0
return _version.calc_hexversion(major, minor, micro, releaselevel, serial=0)
return calc_hexversion(major, minor, micro, releaselevel, serial=0)


def deprecated(func=None, reason=None, replacement=None, since_version=None,
Expand Down Expand Up @@ -154,7 +155,7 @@ def deprecated_warning(type_, name, reason=None, replacement=None,
deprecated_since = hexversion
else:
deprecated_since = _CACHE_VERSIONS[deprecated_since]
log_as_debug = _version.hexversion < deprecated_since
log_as_debug = ref_hexversion < deprecated_since
else:
log_as_debug = False

Expand Down
8 changes: 4 additions & 4 deletions src/fabio/_version.py → version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Project: X-ray image reader
# https://github.com/silx-kit/fabio
#
# Copyright (C) 2015-2023 European Synchrotron Radiation Facility, Grenoble, France
# Copyright (C) 2015-2024 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
Expand Down Expand Up @@ -58,7 +58,7 @@
__contact__ = "Jerome.Kieffer@ESRF.eu"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "07/08/2023"
__date__ = "15/03/2024"
__status__ = "production"
__docformat__ = 'restructuredtext'
__all__ = ["date", "version_info", "strictversion", "hexversion", "debianversion",
Expand All @@ -75,8 +75,8 @@
"beta": "b",
"candidate": "rc"}

MAJOR = 2023
MINOR = 11
MAJOR = 2024
MINOR = 3
MICRO = 0
RELEV = "dev" # <16
SERIAL = 0 # <16
Expand Down

0 comments on commit 5108dc4

Please sign in to comment.