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

First changes in view of Fractal V2 #8

Merged
merged 11 commits into from
Apr 15, 2024
Merged

First changes in view of Fractal V2 #8

merged 11 commits into from
Apr 15, 2024

Conversation

tcompa
Copy link
Collaborator

@tcompa tcompa commented Apr 12, 2024

Close #7

@tcompa
Copy link
Collaborator Author

tcompa commented Apr 12, 2024

Useful command for testing

copier copy gh:fractal-analytics-platform/fractal-tasks-template your-package-name --vcs-ref=v2

@tcompa
Copy link
Collaborator Author

tcompa commented Apr 15, 2024

The template now comes with a GitHub action that runs this script:

#!/bin/bash

# Exit immediately if a command exits with a non-zero status
set -e

# Create empty folder (fail if it already exists)
FOLDER="/tmp/new-project-folder"

# Generate a new project based on the HEAD git reference
echo "Now generate a new project copy in $FOLDER"
copier copy . "$FOLDER" --data-file tests/answers.yml --vcs-ref=HEAD

# Move to the new folder
cd "$FOLDER"

# Install the new project
python3 -m pip install -e .[dev]

# Generate the manifest
python3 src/my_project/dev/create_manifest.py

# Run tests
python3 -m pytest tests

@tcompa tcompa merged commit 37c95c0 into main Apr 15, 2024
1 check passed
@tcompa tcompa deleted the v2 branch April 15, 2024 08:26
@jluethi
Copy link
Collaborator

jluethi commented Apr 15, 2024

Just for my understanding: This script checks that the manifest can be build & that the tests run?

@jluethi
Copy link
Collaborator

jluethi commented Apr 15, 2024

Or is the validity of the manifest tested with that?

@tcompa
Copy link
Collaborator Author

tcompa commented Apr 15, 2024

The script simulates what a new task developer would do:

  1. Create a new project based on the current template (this may catch errors in the template, if we change in the future)
  2. Install the new project (this may catch errors in pyproject.toml, e.g. if we require an invalid fractal-tasks-core version)
  3. Create new manifest (this may catch errors e.g. if we write a new task but we do not correctly set up its call signature, or the function name..)
  4. Run tests (this may catch errors e.g. when we add a test for the new task)

Caveat: this flow differs from what a user would face, because it uses the current HEAD from git (which is useful so that we can run it from the PR branch). Note that the actual usage of copier by default pulls the latest git tag (rather than main or a specific HEAD).

@tcompa
Copy link
Collaborator Author

tcompa commented Apr 15, 2024

I now added:

  1. Performs the build of the package

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.

test_valid_manifest fails after fractal-server refactor
2 participants