Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 36 additions & 16 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,58 @@
# This workflow will upload a Python Package to PyPI when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
push:
branches:
- '*'
release:
types: [published]

permissions:
contents: read

jobs:
release-build:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y pipx
pipx install poetry
poetry install --no-root --with dev

- name: Format check
run: |
poetry run ruff format --check --diff

package-build:
runs-on: ubuntu-latest
needs:
- build

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get tags
run: git fetch --tags origin

- uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Build release distributions
run: |
# NOTE: put your own distribution build steps here.
python -m pip install build
python -m build
python3 -m pip install build
python3 -m build

- name: Upload distributions
uses: actions/upload-artifact@v4
Expand All @@ -41,13 +63,11 @@ jobs:
pypi-publish:
runs-on: ubuntu-latest
needs:
- release-build
- package-build
if: github.event_name == 'release'
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

# Dedicated environments with protections for publishing are strongly recommended.
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
environment:
name: pypi
url: https://pypi.org/p/fync
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
poetry.lock
dist/
36 changes: 22 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,32 @@ pip install git+https://github.com/fanuware/fync.git

### Usage

fync [OPTIONS] COMMAND
fync[OPTIONS] COMMAND

#### Example
#### Example fync

- Observe changes in a specific directory and run a command
Observe changes in a specific directory and run a command

```bash
fync --path=/path/to/observe execute_command
```
```bash
fync --path=/path/to/observe command
```

- Use `cp`
Use `cp`

```bash
fync cp source destination
```
```bash
fync cp source destination
```

- Use `rsync`
Use `rsync`

```bash
fync rsync -av source destination
```
```bash
fync rsync -av source destination
```

#### Example fync-get

Authenticated file download

```bash
fync-get <URL>
```
15 changes: 11 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
[project]
name = "fync"
version = "1.0.0"
dynamic = ["version"]
description = "Automatically trigger command on directory update"
authors = [{ name = "Fanuware", email = "fanuware@gmail.com" }]
license = "MIT"
repository = "https://github.com/fanuware/fync"
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.9,<4.0"
packages = [
{ include = "fync", from = "src" },
]
dependencies = [
"watchdog (>=6.0.0,<7.0.0)",
]

[tool.poetry]
version = "0.0.0"

[tool.poetry-dynamic-versioning]
enable = true

[project.scripts]
fync = 'fync:fync.cli'
fync-get = 'fync:get.cli'

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
requires = ["poetry>=0.12", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.poetry.group.dev.dependencies]
ruff = "^0.9.4"
poetry-dynamic-versioning = "^1.7.1"

[tool.ruff]
line-length = 79
Expand Down
4 changes: 3 additions & 1 deletion src/fync/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def save_credentials(section, credentials):


def cli():
parser = argparse.ArgumentParser(description='File download.')
parser = argparse.ArgumentParser(
description='Authenticated file download.'
)
parser.add_argument(
'urls', nargs=argparse.REMAINDER, help='URLs to download from.'
)
Expand Down