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

docs: add minimal constructor example #2102

Merged
merged 9 commits into from
Sep 24, 2024

Conversation

bollwyvl
Copy link
Contributor

as always, thanks for pixi! ❤️

references

changes

  • adds examples/constructor-minimal

future work

This tries to use the fewest bells and whistles I could manage in both pixi and constructor to still ship something. That being said, it's still needs some dirty tricks due to some inflexibility in both systems without resorting to a more opaque build script.

  • uses pixi-in-pixi
  • uses some of the finicky jinja2 support in constructor
  • using pixi (or py-rattler) as the solver for constructor --conda-exe

There's a lot of opportunity to show more useful things on a separate example, such as:

  • adding inputs and outputs
  • injecting a .conda package built by rattler-build during the build
  • DRYing more inputs, e.g. author -> company, system-dependencies -> virtual_specs
  • using various tools to transform at-rest assets (icon, welcome images) into the (proprietary) platform-specific file formats
  • shipping multiple environments in a single constructor
  • tests

notes

  • it would be lovely to have a zero/one-liner way to get the current platform (ne subdir) without a jq-like tool, e.g.
    • a PIXI_PLATFORM environment variable
    • a minimal info CLI selector language, like pixi info --json '.platform'
      • this would pair well with xargs
  • matrix tasks (as discussed elsewhere)

@bollwyvl
Copy link
Contributor Author

I have no idea how to tell check-yaml to ignore construct.yaml... I guess there could be a construct.yaml.in that gets cated with the specific line to generate a .gitignored (not-).yaml.

@ruben-arts
Copy link
Contributor

Thanks @bollwyvl will review this later. Do you understand why the yaml is not valid?

@bollwyvl
Copy link
Contributor Author

bollwyvl commented Sep 20, 2024 via email

@bollwyvl bollwyvl marked this pull request as ready for review September 21, 2024 13:43
pixi run build

# Install the built installer
pixi run start
Copy link
Contributor

Choose a reason for hiding this comment

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

It now has no error when running this, @bollwyvl, but it's unclear to me what I can expect after this? It doesn't install micromamba for me. Which I assumed, any tips?

@bollwyvl
Copy link
Contributor Author

bollwyvl commented Sep 23, 2024 via email

@ruben-arts
Copy link
Contributor

Yeah, i don't know the right way to demonstrate the built thing... Having built installers do their shell integration is usually really bad. Ideally it should be able to activate itself in a clean shell window or something, but full tests are probably out of scope.

Right I don't want to leave the user with a broken system. If there isn't anything we can show then this is fine by me

@bollwyvl
Copy link
Contributor Author

Well, it could list out the installed packages, i suppose...

@bollwyvl
Copy link
Contributor Author

(oh and I haven't been able to run this locally, as the constructors will be broken until there's a release that emits topo-sorted @EXPLCIT files)

@ruben-arts
Copy link
Contributor

(oh and I haven't been able to run this locally, as the constructors will be broken until there's a release that emits topo-sorted @EXPLCIT files)

That worked for me as I'm on main.

I'm merging it! Thanks @bollwyvl

@ruben-arts ruben-arts merged commit 41eabaf into prefix-dev:main Sep 24, 2024
40 checks passed
@bollwyvl bollwyvl deleted the gh-1375-constructor-example branch September 24, 2024 13:22
@bollwyvl
Copy link
Contributor Author

Thanks! Once there's a release, I'll revisit with a more complete lifecycle example (e.g. .whl -> .conda -> .exe). Last I checked, there wasn't a cross-platform .icns generator on conda-forge for OSX .pkg icons, so maybe i can get that done in the meantime.

@bollwyvl
Copy link
Contributor Author

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

Successfully merging this pull request may close these issues.

2 participants