Skip to content

Commit

Permalink
Poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
nbr23 committed Nov 11, 2022
1 parent 860fd2a commit 45cba06
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 31 deletions.
30 changes: 30 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
pipeline {
agent any

environment {
PYPI_TOKEN = credentials('pypi_token')
}

stages {
stage('Checkout'){
steps {
checkout scm
}
}
stage('Build and publish pypi package') {
when { expression { sh([returnStdout: true, script: "git tag -l --contains $GIT_COMMIT | grep '^v' || true"]) } }
steps {
sh '''
# If we are within docker, we need to hack around to get the volume mount path on the host system for our docker runs down below
if docker inspect `hostname` 2>/dev/null; then
DOCKER_VOLUME_ROOT=$(docker inspect `hostname` | jq -r '.[0].Mounts | .[] | select(.Destination=="/home/jenkins") | .Source')
REAL_PWD=$(echo $PWD | sed "s|/home/jenkins|$DOCKER_VOLUME_ROOT|")
else
REAL_PWD=$PWD
fi
docker run --rm -v $REAL_PWD:/app -w /app python:3.10-slim-buster bash -c "pip install poetry && poetry build -f sdist && poetry publish -n -u __token__ -p $PYPI_TOKEN"
'''
}
}
}
}
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ youtube-dl supported services) channels, using

Install package with requirements:

`pip install git+https://github.com/nbr23/ydl-podcast.git`
### Youtube-dl:

`pip install ydl-podcast[youtube-dl]`

### yt-dlp:

`pip install ydl-podcast[yt-dlp]`

## Configuration

Expand Down
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[tool.poetry]
name = "ydl-podcast"
version = "1.0.0"
description = "A simple tool to generate Podcast-like RSS feeds from youtube (or other youtube-dl supported services) channels, using youtube-dl"
license = "MIT"
authors = ["nbr23 <[email protected]>"]
homepage = "https://github.com/nbr23/ydl-podcast"
repository = "https://github.com/nbr23/ydl-podcast"
keywords = ["podcast", "youtube-dl"]
readme = "README.md"

packages = [
{ include = "ydl_podcast" }
]

[tool.poetry.scripts]
ydl-podcast = 'ydl_podcast.__main__:main'

[tool.poetry.dependencies]
python = "^3.9"
youtube-dl = ">=2021.12.17"
PyYAML = "6.0"
Jinja2 = "^3.1.2"
MarkupSafe = "^2.1.1"
yt-dlp = { version = ">=2022.10.4", optional = true }

[tool.poetry.dev-dependencies]

[tool.poetry.extras]
yt-dlp = ["yt-dlp"]
youtube-dl = ["youtube-dl"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

26 changes: 0 additions & 26 deletions setup.py

This file was deleted.

0 comments on commit 45cba06

Please sign in to comment.