Compare commits
7 Commits
58ef47468e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5dcf51b939 | |||
| f9844d6b82 | |||
| 040588d054 | |||
| cd4055b246 | |||
| 457a974e14 | |||
| ec685d24eb | |||
| 57c0037289 |
@@ -11,15 +11,8 @@ env:
|
|||||||
CONDA: /opt/miniforge3
|
CONDA: /opt/miniforge3
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare:
|
|
||||||
runs-on: pyzebra
|
|
||||||
steps:
|
|
||||||
- run: $CONDA/bin/conda config --add channels conda-forge
|
|
||||||
- run: $CONDA/bin/conda config --set solver libmamba
|
|
||||||
|
|
||||||
test-env:
|
test-env:
|
||||||
runs-on: pyzebra
|
runs-on: pyzebra
|
||||||
needs: prepare
|
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
env:
|
env:
|
||||||
BUILD_DIR: ${{ runner.temp }}/conda_build
|
BUILD_DIR: ${{ runner.temp }}/conda_build
|
||||||
@@ -33,7 +26,6 @@ jobs:
|
|||||||
|
|
||||||
prod-env:
|
prod-env:
|
||||||
runs-on: pyzebra
|
runs-on: pyzebra
|
||||||
needs: prepare
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
env:
|
env:
|
||||||
BUILD_DIR: ${{ runner.temp }}/conda_build
|
BUILD_DIR: ${{ runner.temp }}/conda_build
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
{% set data = load_setup_py_data() %}
|
{% set version_match = load_file_regex(load_file="pyzebra/__init__.py", regex_pattern='__version__ = "(.+?)"') %}
|
||||||
|
{% set version = version_match[1] %}
|
||||||
|
{% set pyproject = load_file_data('pyproject.toml') %}
|
||||||
|
|
||||||
package:
|
package:
|
||||||
name: pyzebra
|
name: {{ pyproject['project']['name'] }}
|
||||||
version: {{ data['version'] }}
|
version: {{ version }}
|
||||||
|
|
||||||
source:
|
source:
|
||||||
path: ..
|
path: ..
|
||||||
@@ -10,26 +12,24 @@ source:
|
|||||||
build:
|
build:
|
||||||
script: python -m pip install .
|
script: python -m pip install .
|
||||||
noarch: python
|
noarch: python
|
||||||
number: 0
|
|
||||||
entry_points:
|
entry_points:
|
||||||
- pyzebra = pyzebra.app.cli:main
|
- pyzebra = pyzebra.app.cli:main
|
||||||
|
|
||||||
requirements:
|
requirements:
|
||||||
build:
|
host:
|
||||||
- python >=3.8
|
- python {{ pyproject['project']['requires-python'] }}
|
||||||
- setuptools
|
- hatchling
|
||||||
run:
|
run:
|
||||||
- python >=3.8
|
- python {{ pyproject['project']['requires-python'] }}
|
||||||
- numpy
|
{% for dep in pyproject['project']['dependencies'] %}
|
||||||
- scipy
|
- {{ dep }}
|
||||||
- h5py
|
{% endfor %}
|
||||||
- bokeh =2.4
|
|
||||||
- numba
|
|
||||||
- lmfit >=1.0.2
|
|
||||||
|
|
||||||
|
|
||||||
about:
|
about:
|
||||||
home: https://gitlab.psi.ch/zebra/pyzebra
|
home: {{ pyproject['project']['urls']['Homepage'] }}
|
||||||
summary: {{ data['description'] }}
|
summary: {{ pyproject['project']['description'] }}
|
||||||
license: GNU GPLv3
|
license: {{ pyproject['project']['license'] }}
|
||||||
license_file: LICENSE
|
license_file:
|
||||||
|
{% for lf in pyproject['project']['license-files'] %}
|
||||||
|
- {{ lf }}
|
||||||
|
{% endfor %}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import argparse
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@@ -13,7 +14,8 @@ def main():
|
|||||||
print(f"Aborting, not on '{default_branch}' branch.")
|
print(f"Aborting, not on '{default_branch}' branch.")
|
||||||
return
|
return
|
||||||
|
|
||||||
version_filepath = os.path.join(os.path.basename(os.path.dirname(__file__)), "__init__.py")
|
project_path = Path(__file__).resolve().parent
|
||||||
|
version_filepath = project_path / project_path.name / "__init__.py"
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("level", type=str, choices=["patch", "minor", "major"])
|
parser.add_argument("level", type=str, choices=["patch", "minor", "major"])
|
||||||
@@ -22,7 +24,7 @@ def main():
|
|||||||
with open(version_filepath) as f:
|
with open(version_filepath) as f:
|
||||||
file_content = f.read()
|
file_content = f.read()
|
||||||
|
|
||||||
version = re.search(r'__version__ = "(.*?)"', file_content).group(1)
|
version = re.search(r'__version__ = "(.+?)"', file_content).group(1)
|
||||||
major, minor, patch = map(int, version.split(sep="."))
|
major, minor, patch = map(int, version.split(sep="."))
|
||||||
|
|
||||||
if args.level == "patch":
|
if args.level == "patch":
|
||||||
@@ -38,7 +40,7 @@ def main():
|
|||||||
new_version = f"{major}.{minor}.{patch}"
|
new_version = f"{major}.{minor}.{patch}"
|
||||||
|
|
||||||
with open(version_filepath, "w") as f:
|
with open(version_filepath, "w") as f:
|
||||||
f.write(re.sub(r'__version__ = "(.*?)"', f'__version__ = "{new_version}"', file_content))
|
f.write(re.sub(r'__version__ = "(.+?)"', f'__version__ = "{new_version}"', file_content))
|
||||||
|
|
||||||
os.system(f"git commit {version_filepath} -m 'Updating for version {new_version}'")
|
os.system(f"git commit {version_filepath} -m 'Updating for version {new_version}'")
|
||||||
os.system(f"git tag -a {new_version} -m 'Release {new_version}'")
|
os.system(f"git tag -a {new_version} -m 'Release {new_version}'")
|
||||||
|
|||||||
35
pyproject.toml
Normal file
35
pyproject.toml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["hatchling"]
|
||||||
|
build-backend = "hatchling.build"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "pyzebra"
|
||||||
|
dynamic = ["version"] # version will be read from __init__.py
|
||||||
|
requires-python = ">=3.8"
|
||||||
|
dependencies = [
|
||||||
|
"numpy",
|
||||||
|
"scipy",
|
||||||
|
"h5py",
|
||||||
|
"bokeh ~=2.4",
|
||||||
|
"numba",
|
||||||
|
"lmfit >=1.0.2",
|
||||||
|
]
|
||||||
|
authors = [
|
||||||
|
{name = "Paul Scherrer Institute"}
|
||||||
|
]
|
||||||
|
maintainers = [
|
||||||
|
{name = "Ivan Usov", email = "ivan.usov@psi.ch"}
|
||||||
|
]
|
||||||
|
description = "An experimental data analysis library for zebra instrument."
|
||||||
|
readme = "README.md"
|
||||||
|
license = "GPL-3.0-or-later"
|
||||||
|
license-files = ["LICENSE"]
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
Homepage = "https://gitea.psi.ch/zebra/pyzebra"
|
||||||
|
|
||||||
|
[tool.hatch.build.targets.wheel]
|
||||||
|
include = ["pyzebra"]
|
||||||
|
|
||||||
|
[tool.hatch.version]
|
||||||
|
path = "pyzebra/__init__.py"
|
||||||
@@ -6,4 +6,4 @@ from pyzebra.sxtal_refgen import *
|
|||||||
from pyzebra.utils import *
|
from pyzebra.utils import *
|
||||||
from pyzebra.xtal import *
|
from pyzebra.xtal import *
|
||||||
|
|
||||||
__version__ = "0.7.11"
|
__version__ = "0.7.12"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ REFLECTION_PRINTER_FORMATS = [
|
|||||||
"oksana",
|
"oksana",
|
||||||
]
|
]
|
||||||
|
|
||||||
ANATRIC_PATH = "/afs/psi.ch/project/sinq/rhel8/bin/anatric"
|
ANATRIC_PATH = "/opt/anatric"
|
||||||
ALGORITHMS = ["adaptivemaxcog", "adaptivedynamic"]
|
ALGORITHMS = ["adaptivemaxcog", "adaptivedynamic"]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import numpy as np
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
SXTAL_REFGEN_PATH = "/afs/psi.ch/project/sinq/rhel8/bin/Sxtal_Refgen"
|
SXTAL_REFGEN_PATH = "/opt/Sxtal_Refgen"
|
||||||
|
|
||||||
_zebraBI_default_geom = """GEOM 2 Bissecting - HiCHI
|
_zebraBI_default_geom = """GEOM 2 Bissecting - HiCHI
|
||||||
BLFR z-up
|
BLFR z-up
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import os
|
|||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
SINQ_PATH = "/afs/psi.ch/project/sinqdata"
|
SINQ_PATH = "/sq_data"
|
||||||
ZEBRA_PROPOSALS_PATH = os.path.join(SINQ_PATH, "{year}/zebra/{proposal}")
|
ZEBRA_PROPOSALS_PATH = os.path.join(SINQ_PATH, "{year}/zebra/{proposal}")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
14
setup.py
14
setup.py
@@ -1,14 +0,0 @@
|
|||||||
import re
|
|
||||||
|
|
||||||
from setuptools import find_packages, setup
|
|
||||||
|
|
||||||
with open("pyzebra/__init__.py") as f:
|
|
||||||
version = re.search(r'__version__ = "(.*?)"', f.read()).group(1)
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name="pyzebra",
|
|
||||||
version=version,
|
|
||||||
description="An experimental data analysis library for zebra instrument.",
|
|
||||||
packages=find_packages(),
|
|
||||||
license="GNU GPLv3",
|
|
||||||
)
|
|
||||||
Reference in New Issue
Block a user