HwCodecDetect 0.1.0__tar.gz → 0.1.1__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 (22) hide show
  1. {hwcodecdetect-0.1.0/src/HwCodecDetect.egg-info → hwcodecdetect-0.1.1}/PKG-INFO +1 -1
  2. hwcodecdetect-0.1.1/VERSION +1 -0
  3. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/pyproject.toml +6 -5
  4. hwcodecdetect-0.1.1/requirements.txt +2 -0
  5. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/setup.py +5 -1
  6. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/src/HwCodecDetect/install_ffmpeg_if_needed.py +40 -16
  7. hwcodecdetect-0.1.1/src/HwCodecDetect/version.py +1 -0
  8. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1/src/HwCodecDetect.egg-info}/PKG-INFO +1 -1
  9. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/src/HwCodecDetect.egg-info/SOURCES.txt +1 -0
  10. hwcodecdetect-0.1.0/VERSION +0 -1
  11. hwcodecdetect-0.1.0/src/HwCodecDetect/version.py +0 -1
  12. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/LICENSE +0 -0
  13. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/MANIFEST.in +0 -0
  14. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/README.md +0 -0
  15. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/setup.cfg +0 -0
  16. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/src/HwCodecDetect/__init__.py +0 -0
  17. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/src/HwCodecDetect/run_tests.py +0 -0
  18. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/src/HwCodecDetect.egg-info/dependency_links.txt +0 -0
  19. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/src/HwCodecDetect.egg-info/entry_points.txt +0 -0
  20. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/src/HwCodecDetect.egg-info/requires.txt +0 -0
  21. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/src/HwCodecDetect.egg-info/top_level.txt +0 -0
  22. {hwcodecdetect-0.1.0 → hwcodecdetect-0.1.1}/src/HwCodecDetect.egg-info/zip-safe +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: HwCodecDetect
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: A cross-platform tool to automatically detect and test hardware video decoders/encoders using FFmpeg.
5
5
  Home-page: https://github.com/whyb/HwCodecDetect
6
6
  Author: whyb
@@ -0,0 +1 @@
1
+ 0.1.1
@@ -4,7 +4,6 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "HwCodecDetect"
7
- version = "0.1.0"
8
7
  authors = [
9
8
  { name="whyb", email="whyber@outlook.com" },
10
9
  ]
@@ -15,10 +14,7 @@ license = "BSD-3-Clause"
15
14
  license-files = [
16
15
  "LICENSE",
17
16
  ]
18
- dependencies = [
19
- "colorama",
20
- "tqdm"
21
- ]
17
+
22
18
  classifiers = [
23
19
  "Programming Language :: Python :: 3",
24
20
  "Operating System :: OS Independent",
@@ -26,6 +22,7 @@ classifiers = [
26
22
  "Topic :: System :: Installation/Setup",
27
23
  "Topic :: Utilities",
28
24
  ]
25
+ dynamic = ["version", "dependencies"]
29
26
 
30
27
  [project.scripts]
31
28
  hwcodecdetect = "HwCodecDetect.run_tests:main"
@@ -33,3 +30,7 @@ hwcodecdetect = "HwCodecDetect.run_tests:main"
33
30
  [project.urls]
34
31
  Homepage = "https://github.com/whyb/HwCodecDetect"
35
32
  Issues = "https://github.com/whyb/HwCodecDetect/issues"
33
+
34
+ [tool.setuptools.dynamic]
35
+ version = {file = ["VERSION"]}
36
+ dependencies = {file = ["requirements.txt"]}
@@ -0,0 +1,2 @@
1
+ colorama
2
+ tqdm
@@ -1,5 +1,9 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
+ def load_requirements(filename="requirements.txt"):
4
+ with open(filename, encoding="utf-8") as f:
5
+ return [line.strip() for line in f if line.strip() and not line.startswith("#")]
6
+
3
7
  with open("README.md", encoding="utf-8") as f:
4
8
  long_description = f.read()
5
9
 
@@ -32,7 +36,7 @@ setup(
32
36
  "Topic :: Utilities",
33
37
  ],
34
38
  python_requires=">=3.8",
35
- install_requires=["colorama", "tqdm"],
39
+ install_requires=load_requirements(),
36
40
  packages=find_packages(where="src"),
37
41
  package_dir={"": "src"},
38
42
  entry_points={
@@ -138,24 +138,48 @@ def install_on_linux():
138
138
  return -1
139
139
 
140
140
  def install_on_macos():
141
- """
142
- Installs FFmpeg using Homebrew for macOS.
143
- """
144
- print("FFmpeg not found. Attempting to install via Homebrew...")
141
+ print("FFmpeg not found. Attempting to install for macOS...")
145
142
 
146
- if not shutil.which("brew"):
147
- print("Homebrew not found. Please install Homebrew first by running:", file=sys.stderr)
148
- print('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"', file=sys.stderr)
149
- return -1
143
+ # Try Homebrew
144
+ if shutil.which("brew"):
145
+ try:
146
+ subprocess.run(["brew", "install", "ffmpeg"], check=True)
147
+ print("FFmpeg installation complete via Homebrew.")
148
+ return 0
149
+ except subprocess.CalledProcessError:
150
+ print("Homebrew installation failed. Trying next method.", file=sys.stderr)
151
+
152
+ # Try MacPorts
153
+ if shutil.which("port"):
154
+ try:
155
+ subprocess.run(["sudo", "port", "install", "ffmpeg"], check=True)
156
+ print("FFmpeg installation complete via MacPorts.")
157
+ return 0
158
+ except subprocess.CalledProcessError:
159
+ print("MacPorts installation failed. Trying next method.", file=sys.stderr)
160
+
161
+ # Try Conda
162
+ if shutil.which("conda"):
163
+ try:
164
+ subprocess.run(["conda", "install", "-c", "conda-forge", "ffmpeg", "-y"], check=True)
165
+ print("FFmpeg installation complete via Conda.")
166
+ return 0
167
+ except subprocess.CalledProcessError:
168
+ print("Conda installation failed. Trying next method.", file=sys.stderr)
169
+
170
+ # Try Nix
171
+ if shutil.which("nix-env"):
172
+ try:
173
+ subprocess.run(["nix-env", "-iA", "nixpkgs.ffmpeg"], check=True)
174
+ print("FFmpeg installation complete via Nix.")
175
+ return 0
176
+ except subprocess.CalledProcessError:
177
+ print("Nix installation failed. Trying next method.", file=sys.stderr)
178
+
179
+ # Manual fallback
180
+ print("All package manager installations failed. Please install FFmpeg manually from https://ffmpeg.org/download.html", file=sys.stderr)
181
+ return -1
150
182
 
151
- try:
152
- print("Attempting to install FFmpeg using brew...")
153
- subprocess.run(["brew", "install", "ffmpeg"], check=True)
154
- print("FFmpeg installation complete.")
155
- return 0
156
- except subprocess.CalledProcessError as e:
157
- print(f"Error installing FFmpeg with Homebrew: {e}", file=sys.stderr)
158
- return -1
159
183
 
160
184
  def get_linux_distro():
161
185
  """
@@ -0,0 +1 @@
1
+ __version__ = "0.1.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: HwCodecDetect
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: A cross-platform tool to automatically detect and test hardware video decoders/encoders using FFmpeg.
5
5
  Home-page: https://github.com/whyb/HwCodecDetect
6
6
  Author: whyb
@@ -3,6 +3,7 @@ MANIFEST.in
3
3
  README.md
4
4
  VERSION
5
5
  pyproject.toml
6
+ requirements.txt
6
7
  setup.py
7
8
  src/HwCodecDetect/__init__.py
8
9
  src/HwCodecDetect/install_ffmpeg_if_needed.py
@@ -1 +0,0 @@
1
- 0.1.0
@@ -1 +0,0 @@
1
- __version__ = "0.1.0"
File without changes
File without changes
File without changes
File without changes