Metadata-Version: 2.5
Name: pullup
Version: 0.0.6
Summary: build, release, and deploy projects
Project-URL: Repository, https://github.com/vedicreader/pullup
Project-URL: Documentation, https://vedicreader.github.io/pullup
Author-email: Karthik Rajgopal <karthik.rajgopal@hotmail.com>
License: Apache-2.0
License-File: LICENSE
Keywords: jupyter,nbdev,notebook,python
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.11
Requires-Dist: cfeasy>=0.0.4
Requires-Dist: dockeasy>=0.0.5
Requires-Dist: fastcore>=1.8.17
Requires-Dist: gheasy>=0.0.10
Requires-Dist: keyring>=25.0.0
Requires-Dist: ptymini>=0.0.5
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: vpseasy>=0.0.18
Description-Content-Type: text/markdown

# pullup


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Install

``` sh
pip install pullup
```

Cloud integrations load only when used.

## Project detection

[`Project`](https://vedicreader.github.io/pullup/project.html#project) detects the release flow from files in the project directory.

``` python
project = Project(root)
project.kind, [step.id for step in project.steps()]
```

    ('nbdev', ['prepare', 'bump', 'gh', 'pypi'])

## Running steps

Steps run in one PTY. Automatic execution stops at the first failure.

``` python
pipeline = Pipeline(root, dir='.demo')
pipeline.save([{'id': 'hello', 'cmd': 'say hello',
                'argv': [sys.executable, '-c', 'print("ready")']}])
await pipeline.start()
pipeline.state()['done'], pipeline.tail().splitlines()[-2:]
```

    (False, ['', '❯ say hello'])

## Plan storage

Plans are written only below the project directory.

``` python
custom = Pipeline(root, dir='.myapp')
custom.save([{'id': 'show', 'cmd': 'show', 'argv': [sys.executable, '-c', 'print("saved")']}])
custom.path.relative_to(root)
```

    Path('.myapp/pipeline.json')

## Deployment pipelines

[`Deploy`](https://vedicreader.github.io/pullup/deploy.html#deploy) runs a project’s deployment script. [`Drive`](https://vedicreader.github.io/pullup/drive.html#drive) exposes each operation as a library call.

``` python
Deploy(root).state()['kind'], Drive(root).state()['kind']
```

    ('deploy', 'drive')

## Workflows

Local workflow inspection needs no GitHub credentials.

``` python
workflow_dir = root/'.github'/'workflows'
workflow_dir.mkdir(parents=True)
(workflow_dir/'ci.yml').write_text('''name: CI
on: push
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - run: pytest
''')
workflows = Workflows(root)
[(row['name'], [job['id'] for job in row['jobs']]) for row in workflows.parsed()]
```

    [('CI', ['test'])]

## Environment

A pipeline injects required values into the child without changing the parent environment.

``` python
class Values:
    def get(self, key, secret=True): return 'demo-token' if key == 'DEMO_TOKEN' else ''
    def values(self, keys): return {key: self.get(key) for key in keys if self.get(key)}

with_values = Pipeline(root, env=Values(), dir='.env-demo')
with_values.save([{'id': 'env', 'cmd': 'read environment', 'needs': ['DEMO_TOKEN'],
                   'argv': [sys.executable, '-c', 'import os; print(os.environ["DEMO_TOKEN"])']}])
await with_values.start()
with_values.tail().splitlines()[-2:]
```

    ['', '❯ read environment']

## Package errors

[`blame`](https://vedicreader.github.io/pullup/stack.html#blame) identifies the deepest selected-package frame.

``` python
trace = '''Traceback (most recent call last):
  File "/tmp/pullup/demo.py", line 7, in release
    raise RuntimeError("stopped")
RuntimeError: stopped
'''
blame(trace, family=['pullup'])
```

    {'package': 'pullup',
     'file': '/tmp/pullup/demo.py',
     'line': 7,
     'fn': 'release',
     'error': 'RuntimeError: stopped',
     'open': '/tmp/pullup/demo.py',
     'checkout': '',
     'version': '0.0.4'}

## Infrastructure

[`Infra.status`](https://vedicreader.github.io/pullup/infra.html#infra.status) reports provider and token availability without making a request.

``` python
infra = Infra(env={})
infra.status()
```

    {'vpseasy': True,
     'cfeasy': True,
     'hcloud_token': True,
     'cf_token': False,
     'keys': ['HCLOUD_TOKEN', 'CLOUDFLARE_API_TOKEN']}
