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

Improve experience of inter-project imports in local projects #7633

Closed
1 of 7 tasks
radeusgd opened this issue Aug 22, 2023 · 2 comments · Fixed by #7634
Closed
1 of 7 tasks

Improve experience of inter-project imports in local projects #7633

radeusgd opened this issue Aug 22, 2023 · 2 comments · Fixed by #7634
Assignees
Labels
-compiler -libs Libraries: New libraries to be implemented p-low Low priority

Comments

@radeusgd
Copy link
Member

Currently, we can easily import 'published' libraries like our Standard library.

The Enso library manager also has capabilities of importing local 'user' libraries, but it has not been used much and so is mostly unknown.

Recently, in #7521 we had a need to share testing logic between Tests and Table_Tests. To achieve this, the common code was moved to Standard.Test library which is shared. That is not desirable, because Standard.Test is a library for creating test suites and it should not itself contain such test suites.

We can fix this by allowing Table_Tests to import the Tests project as a library and import code from it.

To do so we need to:

  • Extend the Table_Tests edition to make it aware of the enso_dev.Tests project.
    • This can be done either by adding a library override to the edition or setting prefer-local-libraries. I did the former as it seems cleaner.
    • One downside is - to be able to define a specific edition, we need to pin the edition version in the project - so for now I've pinned the version to 0.0.0-dev. Overriding edition settings is not compatible with the engine-version: default setting that we've been using (which has been technically deprecated).
      • That may not work with CI which seems to be running the tests with the 'current' version, e.g. overriding 0.0.0-dev to 2023.2.1-dev.
      • To fix that we may have to ensure SBT correctly overwrites the version there OR allow extends: default to extend the current default edition.
  • Make sure that enso_dev.Tests is discoverable from Table_Tests. To achieve that, we need to ensure that test/Tests is on the ENSO_LIBRARY_PATH.
    • Easiest way to override the environment variable.
    • To avoid having to override the environment variable, we should modify the logic for detecting library paths to default to two paths: $ENSO_HOME/lib and the parent directory of the current project (currently only the former is accounted for).
@radeusgd radeusgd self-assigned this Aug 22, 2023
@radeusgd radeusgd added -compiler -libs Libraries: New libraries to be implemented p-low Low priority labels Aug 22, 2023
@radeusgd
Copy link
Member Author

I think once we could get through this, the example of importing Tests from Table_Tests in #7634 will serve as a nice example of how one can depend link Enso projects between each other.

@enso-bot
Copy link

enso-bot bot commented Aug 29, 2023

Radosław Waśko reports a new STANDUP for yesterday (2023-08-28):

Progress: Updated behaviour of library resolution to allow importing Tests from within Table_Tests, added unit tests verifying the behaviour; documentation. Added a benchmark to Column.from_vector PR. Reviews. It should be finished by 2023-08-30.

Next Day: Next day I will be working on the #7238 task. Start work on Table.delete_rows.

@mergify mergify bot closed this as completed in #7634 Sep 1, 2023
@github-project-automation github-project-automation bot moved this from 👁️ Code review to 🟢 Accepted in Issues Board Sep 1, 2023
mergify bot pushed a commit that referenced this issue Sep 1, 2023
…e `Round_Spec.enso` back to `Tests` (#7634)

- Closes #7633
- Moves `Round_Spec.enso` from published `Standard.Test` into our `test/Tests` project; the `Table_Tests` that depend on it, simply `import enso_dev.Tests`.
- Changes the layout of the local libraries directory:
- It used to be `root/<namespace>/<name>`.
- Now it is `root/<dir>` - the namespace and name are now read from `package.yaml` instead.
- Adds the parent directory of the current project to the default `ENSO_LIBRARY_PATH`.
- It is treated as a secondary path, so the default `ENSO_HOME/lib` still takes precedence.
- This allows projects to reference and load 'sibling' projects easily - the only requirement is for the project to enable `prefer-local-libraries: true` or add the other local project to its edition. The edition resolution logic is **not changed**.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-compiler -libs Libraries: New libraries to be implemented p-low Low priority
Projects
Archived in project
1 participant