Skip to content

Commit

Permalink
Fix remote
Browse files Browse the repository at this point in the history
Somehow the remote did not contain the latest changes to my local branch.
This should now be fixed.
  • Loading branch information
gmloose committed Feb 20, 2024
1 parent dcba216 commit ce2b52d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include *.rst *.md
include casacore/.aipsrc
graft casacore/data
graft doc
graft src
graft tests
graft tests
2 changes: 1 addition & 1 deletion casacore/.aipsrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
measures.directory: ${CASACORE_DATA}
measures.directory: ${CASACORE_DATADIR}
6 changes: 3 additions & 3 deletions casacore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

# If environment variable `AIPSPATH` is not set, then set it to the directory
# containing the `.aipsrc` file that is distributed with this package.
# This `.aipsrc` file uses the environment `CASACORE_DATA`, which should point
# to the directory containing the casacore data files.
# This `.aipsrc` file uses the environment `CASACORE_DATADIR`, which should
# point to the directory containing the casacore data files.
if "AIPSPATH" not in os.environ:
root = os.path.dirname(__file__)
os.environ["AIPSPATH"] = root
os.environ["CASACORE_DATA"] = os.path.join(root, "data")
os.environ["CASACORE_DATADIR"] = os.path.join(root, "data")
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,15 @@ def get_extensions():
flag for flag in opt.split() if flag != '-Wstrict-prototypes'
)


def create_symlink(src_dir, dest_dir):
"""
Create a symbolic link from `src_dir` to `dest_dir`, unless `dest_dir` already exists.
Create a symbolic link from `src_dir` to `dest_dir`, unless `dest_dir`
already exists.
Return `dest_dir` upon success, or an empty string upon failure.
"""
if os.path.islink(dest_dir):
os.remove(dest_dir)
try:
os.symlink(src_dir, dest_dir)
except FileExistsError:
Expand All @@ -271,7 +275,7 @@ def create_symlink(src_dir, dest_dir):
class my_build_ext(build_ext_module.build_ext):
def run(self):
casacoreversion = find_casacore_version()
if casacoreversion is not None and LooseVersion(casacoreversion) < LooseVersion(__mincasacoreversion__):
if casacoreversion is not None and LooseVersion(casacoreversion) < LooseVersion(__mincasacoreversion__):
errorstr = "Your casacore version is too old. Minimum is " + __mincasacoreversion__ + \
", you have " + casacoreversion
if casacoreversion == "2.5.0":
Expand All @@ -290,10 +294,10 @@ def run(self):
keywords=['pyrap', 'casacore', 'utilities', 'astronomy'],
long_description=read('README.rst'),
long_description_content_type='text/x-rst',
packages=find_packages() + find_namespace_packages(include=["data.*"]),
packages=find_packages() + find_namespace_packages(include=["casacore.data.*"]),
include_package_data=True,
package_data={
"data": [create_symlink(os.getenv("CASACORE_DATA"), "data")]
"casacore.data": [create_symlink(os.getenv("CASACORE_DATA"), "casacore/data")]
},
ext_modules=get_extensions(),
cmdclass={'build_ext': my_build_ext},
Expand Down

0 comments on commit ce2b52d

Please sign in to comment.