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

Migrate to Hatch and add a _legacy dependencies_ flavour #54

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

alexbarcelo
Copy link
Member

This branch uses Hatch as the build engine for the dataClay project, and that allows some fancy --config-settings=LEGACY_DEPS=True that can be used to force a set of dependencies in the past (needed for compatibility with certain 3rd party libraries, AI frameworks, etc.).

Given that I was already there, some cleanup on the build infrastructure and building protos during build process and streamlined docker image generation.

!pyproject.toml
!README.md
!MANIFEST.in
!tests
!tox.ini
.dockerignore

# Reexclude protos
src/dataclay/proto
Copy link
Member

Choose a reason for hiding this comment

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

Won't it prevent dataClay running out of the box without having to generate protos?

Copy link
Member Author

Choose a reason for hiding this comment

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

In theory, the [tool.hatch.build.hooks.custom] section of pyproject.toml is responsible of calling the compile_protos script on build time.

This "build time" should be:

  • when doing a pip install -e . for development
  • when doing a build process and generating the wheel
  • when doing a pip install git+https:// also for development-adjacent

Am I wrong? Could you confirm if that's the case?

with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=edge,suffix=-legacydeps-py${{ matrix.python-version }},branch=main
Copy link
Member

Choose a reason for hiding this comment

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

This will create all tags with -legacydeps suffix. Is it correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

There are two sections, the id: meta and the id: legacy-deps-meta, and there are two build, build-and-push and build-and-push-legacy-deps. If I didn't do anything wrong, they should be separate images and we should obtain both the historical regular tags, and the one with -legacydeps that configure legacy dependencies. At least, that is what I intended.

@@ -3,11 +3,11 @@
# Define which Python versions to test with
PYPROJECT = nox.project.load_toml("pyproject.toml")
PYTHON_VERSIONS = nox.project.python_versions(PYPROJECT)
Copy link
Member

Choose a reason for hiding this comment

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

I get the following error when running nox:

AttributeError: module 'nox.project' has no attribute 'python_versions'

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a feature that was added on october lol.

wntrblm/nox@040a93c

Upgrade your nox. Given that nox is for developers only, I think that we can be a little bit early adopter on that 🙃

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.

3 participants