udown 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. udown-0.0.2/.app-version +1 -0
  2. udown-0.0.2/.coveragerc +35 -0
  3. udown-0.0.2/.github/pull_request_template.md +36 -0
  4. udown-0.0.2/.github/workflows/release.yml +92 -0
  5. udown-0.0.2/.github/workflows/test.yml +66 -0
  6. udown-0.0.2/.github/workflows/version-check.yml +50 -0
  7. udown-0.0.2/.gitignore +19 -0
  8. udown-0.0.2/.pylintrc +597 -0
  9. udown-0.0.2/.python-version +1 -0
  10. udown-0.0.2/LICENSE +21 -0
  11. udown-0.0.2/MANIFEST.in +6 -0
  12. udown-0.0.2/Makefile +39 -0
  13. udown-0.0.2/PKG-INFO +234 -0
  14. udown-0.0.2/README.md +197 -0
  15. udown-0.0.2/main.py +9 -0
  16. udown-0.0.2/pyproject.toml +71 -0
  17. udown-0.0.2/pytest.ini +2 -0
  18. udown-0.0.2/scripts/activate_env.sh +30 -0
  19. udown-0.0.2/scripts/build-package.py +52 -0
  20. udown-0.0.2/scripts/build-package.sh +55 -0
  21. udown-0.0.2/scripts/check_format.sh +12 -0
  22. udown-0.0.2/scripts/clean.sh +27 -0
  23. udown-0.0.2/scripts/create-tag.sh +56 -0
  24. udown-0.0.2/scripts/format.sh +10 -0
  25. udown-0.0.2/scripts/install.sh +57 -0
  26. udown-0.0.2/scripts/lint.sh +9 -0
  27. udown-0.0.2/scripts/publish-test.sh +111 -0
  28. udown-0.0.2/scripts/quality.sh +19 -0
  29. udown-0.0.2/scripts/show_cli_help.sh +9 -0
  30. udown-0.0.2/scripts/test.sh +18 -0
  31. udown-0.0.2/scripts/typecheck.sh +9 -0
  32. udown-0.0.2/setup.cfg +4 -0
  33. udown-0.0.2/tests/test_downloader.py +112 -0
  34. udown-0.0.2/udown.egg-info/PKG-INFO +234 -0
  35. udown-0.0.2/udown.egg-info/SOURCES.txt +42 -0
  36. udown-0.0.2/udown.egg-info/dependency_links.txt +1 -0
  37. udown-0.0.2/udown.egg-info/entry_points.txt +2 -0
  38. udown-0.0.2/udown.egg-info/requires.txt +11 -0
  39. udown-0.0.2/udown.egg-info/top_level.txt +1 -0
  40. udown-0.0.2/ytdl/__init__.py +11 -0
  41. udown-0.0.2/ytdl/cli.py +98 -0
  42. udown-0.0.2/ytdl/downloader.py +126 -0
  43. udown-0.0.2/ytdl/profiler.py +56 -0
  44. udown-0.0.2/ytdl/utils.py +46 -0
@@ -0,0 +1 @@
1
+ 0.0.2
@@ -0,0 +1,35 @@
1
+ [run]
2
+ source = ytdl
3
+ omit =
4
+ */_version.py
5
+ */tests/*
6
+ */test_*
7
+ */__pycache__/*
8
+ */venv/*
9
+ */.venv/*
10
+ */env/*
11
+ */.env/*
12
+ */build/*
13
+ */dist/*
14
+ */.git/*
15
+ */.tox/*
16
+ */.pytest_cache/*
17
+
18
+ [report]
19
+ exclude_lines =
20
+ pragma: no cover
21
+ def __repr__
22
+ if self.debug:
23
+ if settings.DEBUG
24
+ raise AssertionError
25
+ raise NotImplementedError
26
+ if 0:
27
+ if __name__ == .__main__.:
28
+ class .*\bProtocol\):
29
+ @(abc\.)?abstractmethod
30
+
31
+ [html]
32
+ directory = htmlcov
33
+
34
+ [xml]
35
+ output = coverage.xml
@@ -0,0 +1,36 @@
1
+ ## Description
2
+ Brief description of the changes
3
+
4
+ ## Type of Change
5
+ - [ ] Bug fix (non-breaking change which fixes an issue)
6
+ - [ ] New feature (non-breaking change which adds functionality)
7
+ - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
8
+ - [ ] Documentation update
9
+
10
+ ## Changelog Entry
11
+ <!--
12
+ Please provide a changelog entry for this PR. This will be automatically added to CHANGELOG.md.
13
+ Use one of the following categories: Added, Changed, Deprecated, Removed, Fixed, Security
14
+ Leave blank if no changelog entry is needed (e.g., internal changes, tests, docs)
15
+ -->
16
+
17
+ ### Added
18
+ -
19
+
20
+ ### Changed
21
+ -
22
+
23
+ ### Fixed
24
+ -
25
+
26
+ ### Security
27
+ -
28
+
29
+ ## Testing
30
+ - [ ] I have tested these changes locally
31
+ - [ ] I have added tests that prove my fix is effective or that my feature works
32
+
33
+ ## Checklist
34
+ - [ ] My code follows the code style of this project
35
+ - [ ] I have updated the documentation accordingly
36
+ - [ ] I have filled out the changelog entry above
@@ -0,0 +1,92 @@
1
+ name: Release to TestPyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write # Required to create releases
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ fetch-depth: 0 # Ensure full git history for setuptools_scm
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v4
20
+ with:
21
+ python-version: '3.11'
22
+
23
+ - name: Install dependencies
24
+ run: pip install build twine
25
+
26
+ - name: Build package
27
+ run: |
28
+ python -m build
29
+
30
+ - name: Check for .app-version file
31
+ run: |
32
+ VERSION_FILE=".app-version"
33
+ if [ ! -f "$VERSION_FILE" ]; then
34
+ echo "Error: $VERSION_FILE does not exist."
35
+ exit 1
36
+ fi
37
+
38
+ - name: Check package files
39
+ run: |
40
+ VERSION=$(cat .app-version)
41
+ echo "Checking package files for version: $VERSION"
42
+
43
+ echo "🔍 Checking built package files..."
44
+ if [ ! -f "dist/udown-$VERSION.tar.gz" ] && [ ! -f "dist/udown-$VERSION-py3-none-any.whl" ]; then
45
+ echo "❌ No package files found in dist/ directory"
46
+ exit 1
47
+ fi
48
+ echo "✅ Package files found in dist/ directory"
49
+ python -m twine check dist/*
50
+
51
+ - name: Get version from .app-version
52
+ id: vars
53
+ run: |
54
+ VERSION=$(cat .app-version)
55
+ echo "tag_name=v$VERSION" >> $GITHUB_OUTPUT
56
+ echo "release_name=v$VERSION-beta" >> $GITHUB_OUTPUT
57
+
58
+ - name: Create GitHub Release
59
+ uses: actions/create-release@v1
60
+ env:
61
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62
+ with:
63
+ tag_name: ${{ steps.vars.outputs.tag_name }}
64
+ release_name: Release ${{ steps.vars.outputs.release_name }}
65
+ body: |
66
+ ## What's Changed
67
+
68
+ - Parallel audio and video downloads
69
+ - Performance profiling and timing reports
70
+ - Caption/subtitle support
71
+ - Cross-platform compatibility
72
+
73
+ ## Installation
74
+
75
+ ```bash
76
+ pip install --index-url https://test.pypi.org/simple/ udown
77
+ ```
78
+
79
+ ## Usage
80
+
81
+ ```bash
82
+ udown -d ~/Downloads/udown [youtube_url]
83
+ ```
84
+ draft: false
85
+ prerelease: true
86
+
87
+ # - name: Publish to TestPyPI
88
+ # env:
89
+ # TWINE_USERNAME: __token__
90
+ # TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
91
+ # run: |
92
+ # python -m twine upload --repository testpypi dist/* --verbose
@@ -0,0 +1,66 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: [3.11]
15
+ # python-version: [3.9, 3.10, 3.11, 3.12]
16
+
17
+
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v4
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ python -m venv .venv
30
+ source .venv/bin/activate
31
+ pip install -e ".[dev]"
32
+
33
+ - name: Run linters with pylint
34
+ run: |
35
+ source .venv/bin/activate
36
+ pylint ytdl/ tests/ --fail-under=10.0
37
+
38
+ - name: Run type checks with mypy
39
+ run: |
40
+ source .venv/bin/activate
41
+ mypy ytdl/
42
+
43
+ - name: Run test and check coverage
44
+ run: |
45
+ source .venv/bin/activate
46
+ python -m pytest \
47
+ --cov=ytdl \
48
+ --cov-branch \
49
+ --cov-report=xml \
50
+ --cov-fail-under=40
51
+
52
+ - name: Check App Version presence
53
+ run: |
54
+ VERSION_FILE=".app-version"
55
+ if [ ! -f "$VERSION_FILE" ]; then
56
+ echo "Error: $VERSION_FILE does not exist."
57
+ exit 1
58
+ fi
59
+
60
+ - name: Upload coverage to Codecov
61
+ uses: codecov/codecov-action@v5
62
+ with:
63
+ files: ./coverage.xml
64
+ verbose: true
65
+ token: ${{ secrets.CODECOV_TOKEN }}
66
+ slug: dipanjal/udown
@@ -0,0 +1,50 @@
1
+ name: Check Version Increment
2
+ # This workflow checks if the version file has been incremented
3
+ # It runs on pushes to feature branches and pull requests to main
4
+
5
+ on:
6
+ push:
7
+ branches:
8
+ - 'feature/**'
9
+ pull_request:
10
+ branches:
11
+ - main
12
+
13
+ jobs:
14
+ version-check:
15
+ runs-on: ubuntu-latest
16
+ if: startsWith(github.ref, 'refs/heads/feature/')
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Fetch main branch
21
+ id: main-branch
22
+ run: |
23
+ git fetch origin main
24
+ MAIN_BRANCH_VERSION=$(git show origin/main:.app-version)
25
+ echo "version=$MAIN_BRANCH_VERSION" >> $GITHUB_OUTPUT
26
+
27
+ - name: Check App Version presence
28
+ run: |
29
+ VERSION_FILE=".app-version"
30
+ if [ ! -f "$VERSION_FILE" ]; then
31
+ echo "Error: $VERSION_FILE does not exist."
32
+ exit 1
33
+ fi
34
+
35
+ - name: Check App Version increment
36
+ run: |
37
+ VERSION_FILE=".app-version"
38
+
39
+ CURRENT_VERSION=$(cat "$VERSION_FILE")
40
+ MAIN_BRANCH_VERSION=${{steps.main-branch.outputs.version}}
41
+ echo "Main branch version: $MAIN_BRANCH_VERSION"
42
+
43
+ if [[ "$CURRENT_VERSION" == "$MAIN_BRANCH_VERSION" ]]; then
44
+ echo "⚠️ $VERSION_FILE has not been incremented."
45
+ echo "It is still same as main branch version: $MAIN_BRANCH_VERSION"
46
+ exit 1
47
+ else
48
+ echo "✅ $VERSION_FILE has been incremented from $MAIN_BRANCH_VERSION to $CURRENT_VERSION"
49
+ fi
50
+
udown-0.0.2/.gitignore ADDED
@@ -0,0 +1,19 @@
1
+ __pycache__
2
+ .idea/
3
+ .mypy_cache
4
+ /.venv/*
5
+
6
+ /.coverage
7
+ /htmlcov
8
+ .fleet
9
+
10
+ **/.DS_Store
11
+
12
+ downloads
13
+ temp
14
+ dist
15
+ *.egg-info
16
+
17
+ # Generated version file
18
+ ytdl/_version.py
19
+ build