Skip to content

Commit d35bb5b

Browse files
tacaswellbriantoby
andauthored
See Add ciffile dependency (#142)
* BLD: do not track build product * BLD: add pycifrw dep to pyproject.toml * BLD: be forgiving about a detached head This happens on CI * keep git_version.py file; but have build create an alternate ignored file (saved_version.py) * BLD: get generated executables into install-editable pixi install (assumes a lot w/r path names) * BLD: remove broken windows build from self-test suite --------- Co-authored-by: BHT <[email protected]>
1 parent 3ab4088 commit d35bb5b

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

.github/workflows/smoke_test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ jobs:
2727
os:
2828
- name: 'ubuntu-22.04'
2929
- name: 'macos-latest'
30-
- name: 'windows-latest'
31-
cmd_extra: '-win'
30+
# windows build is broken; don't test for now
31+
# - name: 'windows-latest'
32+
# cmd_extra: '-win'
3233
env: ['py310', 'py311', 'py312', 'py313']
3334
runs-on: ${{ matrix.os.name }}
3435
steps:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ config.py
55
debug_setup.py.example
66
debug_setup.py
77

8+
# created by install/saved-versions.py
9+
GSASII/saved_version.py
10+
811
# created on MacOS by makeMacApp.py
912
GSAS-II.app/
1013
GSAS-II.py

GSASII/install/save-versions.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# record tag number and git hash into the git_version.py file.
1+
# record tag number and git hash into a saved_version.py file.
22
#
33
import os
44
import sys
@@ -19,9 +19,7 @@
1919
#if g2repo.active_branch.name != 'master':
2020
# print(f'Not on master branch {commit0[:6]!r}')
2121
# sys.exit()
22-
if g2repo.head.is_detached:
23-
print(f'Detached head {commit0[:6]!r}')
24-
sys.exit()
22+
2523
# create a file with GSAS-II version information
2624
try:
2725
g2repo = git.Repo(path2repo)
@@ -36,6 +34,7 @@
3634
now = dt.datetime.now().replace(
3735
tzinfo=commit.committed_datetime.tzinfo)
3836
commit0 = commit.hexsha
37+
3938
#tags0 = g2repo.git.tag('--points-at',commit).split('\n')
4039
tags0 = [i for i in g2repo.git.tag('--points-at',commit).split('\n') if i.isdecimal()]
4140
history = list(g2repo.iter_commits('HEAD'))
@@ -47,7 +46,7 @@
4746
tagsm1 = [i for i in tags.split('\n') if i.isdecimal()]
4847
if not tagsm1: continue
4948
break
50-
pyfile = os.path.join(path2GSAS2,'git_verinfo.py')
49+
pyfile = os.path.join(path2GSAS2,'saved_version.py')
5150
try:
5251
fp = open(pyfile,'w')
5352
except:

pixi/pixi.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ platforms = ["linux-64", "win-64", "osx-arm64"]
1515
[tasks]
1616

1717
clean-build = { cmd = "(rm dist/*whl || true) && (rm -r build || true) ", cwd='../' }
18-
savetags = { cmd = "python save-versions.py", cwd='../GSASII/install' }
18+
saveversions = { cmd = "python save-versions.py", cwd='../GSASII/install' }
1919
build = { cmd = "python -m build -wnx -vvvv -Cbuild-dir='build'", cwd='../', depends-on = ['clean-build']}
20-
install = { cmd = "pip install dist/*whl --force-reinstall --no-deps" , cwd='../', depends-on=['savetags', 'build']}
21-
install-editable = { cmd = "pip install -ve . --no-build-isolation" , cwd='../', depends-on=['clean-build', 'savetags']}
20+
install = { cmd = "pip install dist/*whl --force-reinstall --no-deps" , cwd='../', depends-on=['saveversions', 'build']}
21+
# following contains a rather messy way to get files into bin area
22+
install-editable = { cmd = "pip install -ve . --no-build-isolation; /bin/cp -v $(find ./build -name convcell) ./pixi/.pixi/envs/default/bin/; /bin/cp -v $(find ./build -name LATTIC) ./pixi/.pixi/envs/default/bin/", cwd='../', depends-on=['clean-build', 'saveversions']}
2223

24+
# at present all windows stuff is questionable because flang does not [yet] work for GSAS-II binaries
2325
build-win = { cmd = "python -m build -wnx -vvvv -Cbuild-dir='build'", cwd='../', depends-on = ['clean-build'] , env={CC = 'clang-cl', CXX ='clang-cl'}}
24-
install-win = { cmd = "pip install dist/*whl --force-reinstall --no-deps" , cwd='../', depends-on=['savetags', 'build-win']}
25-
install-editable-win = { cmd = "pip install -ve . --no-build-isolation" , cwd='../', depends-on=['clean-build', 'savetags'] , env={CC = 'clang-cl', CXX ='clang-cl'}}
26+
install-win = { cmd = "pip install dist/*whl --force-reinstall --no-deps" , cwd='../', depends-on=['saveversions', 'build-win']}
27+
install-editable-win = { cmd = "pip install -ve . --no-build-isolation" , cwd='../', depends-on=['clean-build', 'saveversions'] , env={CC = 'clang-cl', CXX ='clang-cl'}}
2628

2729
build-and-go ={ depends-on= ["install", "ui"]}
2830
build-and-go-win ={ depends-on= ["install-win", "ui"]}

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ keywords = ["diffraction", "crystallography", "diffraction",
4040
dependencies = [
4141
"numpy",
4242
"scipy",
43+
"pycifrw",
4344
]
4445

4546
[project.optional-dependencies]

0 commit comments

Comments
 (0)