Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relic hook makes offline installation tricky #175

Open
AldenJurling opened this issue May 3, 2021 · 4 comments
Open

relic hook makes offline installation tricky #175

AldenJurling opened this issue May 3, 2021 · 4 comments
Assignees

Comments

@AldenJurling
Copy link

This block in setup.py:

if not pkgutil.find_loader('relic'):
    relic_local = os.path.exists('relic')
    relic_submodule = (relic_local and
                       os.path.exists('.gitmodules') and
                       not os.listdir('relic'))
    try:
        if relic_submodule:
            check_call(['git', 'submodule', 'update', '--init', '--recursive'])
        elif not relic_local:
            check_call(['git', 'clone', 'https://github.com/spacetelescope/relic.git'])

        sys.path.insert(1, 'relic')
    except CalledProcessError as e:
        print(e)
        exit(1)

makes it tricky to install pysiaf in an offline environment. relic is required during package installation, but is not otherwise declared as a dependency anywhere. If you don't do anything special, it will try to go down the git clone path, which is of course not possible without internet access.

There are sort of two related issues in here: First, when collecting a set of requirements in your online environment for later deployment, relic will not be collected automatically. Second, even if you have a wheel for relic, pip doesn't know it needs to install to install relic before it can install pysiaf.

I believe this is an example of the problem the build system requirements section of pyproject.toml was intended to solve. If pysiaf had a pyproject.toml, it could read

[build-system]
requires = ["setuptools", "wheel", "relic"]
build-backend = "setuptools.build_meta"

which I think would cue pip to do the right thing. However, I unfortunately I haven't worked on a project that uses pyproject.toml or migrated my own to it, so I'm not 100% sure on how that works, or if any other changes to setup.py or requirements declaration would be needed.

I've worked around the issue in my particular application by explicitly added relic to my set of up requirements, and doing a first pip install pass for setuptools wheel relic, but it took a little exploration to understand the issue.

@mperrin, FYI, this indirectly impacts offline installation of webbpsf through the pysiaf dependency, which is what got me here. Fortunately the workaround isn't too hard.

@mperrin
Copy link
Collaborator

mperrin commented May 3, 2021

@shanosborne see above from Alden.

Is relic even still supported/maintained at this point? I think not, deprecated in favor of setuptools_scm. Maybe consider updating pysiaf to be more consistent with the current stsci-package-template and with how we do things elsewhere in webbpsf and poppy?

@shanosborne
Copy link
Collaborator

I am actually no longer a developer on pysiaf, so I'll pass this issue off to the new developer @mfixstsci

@mfixstsci
Copy link
Collaborator

Hey All, I can take a look it this afternoon.

@mfixstsci mfixstsci self-assigned this May 4, 2021
@Witchblade101
Copy link
Collaborator

I think this was also solved with Issue #231 , but I'll test it before we close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants