Skip to content

Revert "package import: remove magic import line"#39380

Merged
haampie merged 1 commit intodevelopfrom
revert-39183-fix/drop-magic-package-import
Aug 11, 2023
Merged

Revert "package import: remove magic import line"#39380
haampie merged 1 commit intodevelopfrom
revert-39183-fix/drop-magic-package-import

Conversation

@tgamblin
Copy link
Copy Markdown
Member

Reverts #39183

I'm in favor of this change but I think we need to revert it until there is an easy path to NOT break people who have external repositories.

2/3 of our users have external package repositories, according to our survey. Many of them have been using them since before 0.19. While we did deprecate this, we didn't warn users about this change -- i.e. we didn't actually print warnings that the functionality was going away. We need to give them a clear error message and an option to automatically fix the package files.

@tgamblin tgamblin requested review from alalazo and haampie August 10, 2023 19:36
@spackbot-app spackbot-app bot added build-environment core PR affects Spack core functionality tests General test capability(ies) labels Aug 10, 2023
@tgamblin
Copy link
Copy Markdown
Member Author

Note also that this wasn't mentioned at #30634

@haampie
Copy link
Copy Markdown
Member

haampie commented Aug 10, 2023

We could turn it into the equivalent of

try:
  import x
except NameError:
  from spack.package import *
  import x
  warning(...)

for 0.21 and remove it in 0.22

Copy link
Copy Markdown
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me if we want to proceed first with a warning. Another alternative would be to give users a command to update the package.py files automatically and print it clearly in the error message.

@haampie haampie merged commit ea08253 into develop Aug 11, 2023
@haampie haampie deleted the revert-39183-fix/drop-magic-package-import branch August 11, 2023 07:04
mpokorny pushed a commit to mpokorny/spack that referenced this pull request Sep 18, 2023
harshula added a commit to ACCESS-NRI/access-spack-packages that referenced this pull request Feb 12, 2024
* Spack is planning on removing the implicit import of spack.package.
  See spack/spack#39380
* Recommended changes from the code review have been add.
  See #21
harshula added a commit to ACCESS-NRI/access-spack-packages that referenced this pull request Feb 13, 2024
* Spack is planning on removing the implicit import of spack.package.
  See spack/spack#39380
* Recommended changes from the code review have been add.
  See #21
harshula added a commit to ACCESS-NRI/access-spack-packages that referenced this pull request Feb 14, 2024
* Spack is planning on removing the implicit import of spack.package.
  See spack/spack#39380
* Recommended changes from the code review have been added.
  See #21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-environment core PR affects Spack core functionality tests General test capability(ies)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants