Skip to content

Commit f13b85d

Browse files
committed
adjust docs.
1 parent 7f477d3 commit f13b85d

1 file changed

Lines changed: 23 additions & 30 deletions

File tree

docs/source/how_to_guides/portability.md

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,6 @@ The lockfile format and behavior are documented in the
88
[reference guide](../reference_guides/lockfile.md).
99
```
1010

11-
## What makes a project portable
12-
13-
There are two things that must stay stable across machines:
14-
15-
First, task and node IDs must be stable. An ID is the unique identifier that ties a task
16-
or node to an entry in `pytask.lock`. pytask builds these IDs from project-relative
17-
paths anchored at the project root, so most users do not need to do anything. If you
18-
implement custom nodes, make sure their IDs remain project-relative and stable across
19-
machines.
20-
21-
Second, state values must be portable. The lockfile stores opaque state strings from
22-
`PNode.state()` and `PTask.state()`, and pytask uses them to decide whether a task is up
23-
to date. Content hashes are portable; timestamps or absolute paths are not. This mostly
24-
matters when you define custom nodes or custom hash functions.
25-
2611
## How to port a project
2712

2813
Use this checklist when you move a project to another machine or environment.
@@ -36,37 +21,45 @@ Use this checklist when you move a project to another machine or environment.
3621
```
3722

3823
If you already have a recent lockfile and up-to-date outputs, you can skip this step.
39-
If the lockfile has stale entries, clean it first:
40-
41-
```console
42-
$ pytask build --clean-lockfile
43-
```
4424

4525
1. **Ship the right files.**
4626

4727
Commit `pytask.lock` to your repository and move it with the project. In practice,
4828
you should move:
4929

50-
- the project files tracked in version control (source, configuration, data inputs)
51-
- `pytask.lock`
30+
- the project files tracked in version control (source, configuration, data inputs
31+
and `pytask.lock`)
5232
- the build artifacts you want to reuse (often in `bld/` if you follow the tutorial
5333
layout)
34+
- the `.pytask` folder in case you are using the data catalog and it manages some of
35+
the files
5436

55-
The lockfile does not contain the artifacts themselves. If you move only the lockfile
56-
but not the outputs, pytask will re-run tasks because output states will not match.
57-
58-
1. **Preserve relative paths.**
37+
1. **Files outside the project**
5938

60-
IDs are project-relative. If your dependencies or products live outside the project
61-
root, their IDs include `..` segments. Make sure the same relative layout exists on
62-
the target machine, or update the paths and run `pytask build` once to refresh
63-
`pytask.lock`.
39+
If you have files outside the project root (the folder with the `pyproject.toml`
40+
file), you need to make sure that the same relative layout exists on the target
41+
machine.
6442

6543
1. **Run pytask on the target machine.**
6644

6745
When states match, tasks are skipped. When they differ, tasks run and the lockfile is
6846
updated.
6947

48+
## What makes a project portable
49+
50+
There are two things that must stay stable across machines:
51+
52+
First, task and node IDs must be stable. An ID is the unique identifier that ties a task
53+
or node to an entry in `pytask.lock`. pytask builds these IDs from project-relative
54+
paths anchored at the project root, so most users do not need to do anything. If you
55+
implement custom nodes, make sure their IDs remain project-relative and stable across
56+
machines.
57+
58+
Second, state values must be portable. The lockfile stores opaque state strings from
59+
`PNode.state()` and `PTask.state()`, and pytask uses them to decide whether a task is up
60+
to date. Content hashes are portable; timestamps or absolute paths are not. This mostly
61+
matters when you define custom nodes or custom hash functions.
62+
7063
## Tips for stable state values
7164

7265
- Prefer file content hashes over timestamps for custom nodes.

0 commit comments

Comments
 (0)