audioarxiv 0.1.2rc59.post1__tar.gz → 0.1.2rc62.post1__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 (61) hide show
  1. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.github/workflows/CI.yml +1 -1
  2. audioarxiv-0.1.2rc62.post1/CODE_OF_CONDUCT.md +132 -0
  3. audioarxiv-0.1.2rc62.post1/CONTRIBUTING.md +80 -0
  4. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/PKG-INFO +17 -2
  5. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/README.md +11 -1
  6. audioarxiv-0.1.2rc62.post1/SECURITY.md +36 -0
  7. audioarxiv-0.1.2rc62.post1/SUPPORT.md +29 -0
  8. audioarxiv-0.1.2rc62.post1/codecov.yml +12 -0
  9. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/cspell.json +4 -1
  10. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/release_notes.rst +2 -0
  11. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/pyproject.toml +6 -0
  12. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/src/audioarxiv/__init__.py +1 -1
  13. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/src/audioarxiv/audio/base.py +1 -0
  14. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/src/audioarxiv/resources/paper.py +3 -0
  15. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/tests/audio/test_base.py +81 -0
  16. audioarxiv-0.1.2rc62.post1/tests/resources/test_paper.py +183 -0
  17. audioarxiv-0.1.2rc59.post1/CODE_OF_CONDUCT.md +0 -9
  18. audioarxiv-0.1.2rc59.post1/SUPPORT.md +0 -7
  19. audioarxiv-0.1.2rc59.post1/tests/resources/test_paper.py +0 -66
  20. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.devcontainer/Dockerfile +0 -0
  21. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.devcontainer/devcontainer.json +0 -0
  22. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.github/dependabot.yml +0 -0
  23. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.github/template-sync.yml +0 -0
  24. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.github/workflows/publish.yml +0 -0
  25. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.github/workflows/schedule-update-actions.yml +0 -0
  26. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.github/workflows/semantic-pr-check.yml +0 -0
  27. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.github/workflows/sphinx.yml +0 -0
  28. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.github/workflows/template-sync.yml +0 -0
  29. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.gitignore +0 -0
  30. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.pre-commit-config.yaml +0 -0
  31. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.pypirc +0 -0
  32. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.vscode/launch.json +0 -0
  33. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/.vscode/settings.json +0 -0
  34. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/LICENSE +0 -0
  35. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/.gitignore +0 -0
  36. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/Makefile +0 -0
  37. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/conf.py +0 -0
  38. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/devcontainer.md +0 -0
  39. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/developer.md +0 -0
  40. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/index.rst +0 -0
  41. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/installation.rst +0 -0
  42. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/make.bat +0 -0
  43. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/pre-commit-config.md +0 -0
  44. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/pylint.md +0 -0
  45. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/pyproject.md +0 -0
  46. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/requirements.txt +0 -0
  47. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/templates/custom-class-template.rst +0 -0
  48. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/templates/custom-module-template.rst +0 -0
  49. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/user_guide.rst +0 -0
  50. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/vscode.md +0 -0
  51. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/docs/workflows.md +0 -0
  52. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/src/audioarxiv/audio/__init__.py +0 -0
  53. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/src/audioarxiv/preprocess/__init__.py +0 -0
  54. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/src/audioarxiv/preprocess/article.py +0 -0
  55. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/src/audioarxiv/preprocess/math_equation.py +0 -0
  56. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/src/audioarxiv/resources/__init__.py +0 -0
  57. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/src/audioarxiv/tools/__init__.py +0 -0
  58. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/src/audioarxiv/tools/main.py +0 -0
  59. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/tests/preprocess/test_article.py +0 -0
  60. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/tests/preprocess/test_math_equation.py +0 -0
  61. {audioarxiv-0.1.2rc59.post1 → audioarxiv-0.1.2rc62.post1}/tests/tools/test_main.py +0 -0
@@ -36,7 +36,7 @@ jobs:
36
36
 
37
37
  - name: Run tests with coverage
38
38
  run: |
39
- pytest --cov=audioarxiv --cov-report=xml
39
+ pytest --cov=audioarxiv --cov-report=xml -m ""
40
40
 
41
41
  - name: Upload coverage to Codecov
42
42
  uses: codecov/codecov-action@v5
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ - Demonstrating empathy and kindness toward other people
21
+ - Being respectful of differing opinions, viewpoints, and experiences
22
+ - Giving and gracefully accepting constructive feedback
23
+ - Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ - Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ - The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ - Trolling, insulting or derogatory comments, and personal or political attacks
33
+ - Public or private harassment
34
+ - Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ - Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,80 @@
1
+ # Contributing to audioarxiv
2
+
3
+ 🎉 Thank you for your interest in contributing to `audioarxiv`! 🎧📚
4
+ Your ideas, fixes, and improvements are welcome and appreciated.
5
+
6
+ Whether you’re fixing a typo, reporting a bug, suggesting a feature, or submitting a pull request—this guide will help you get started.
7
+
8
+ ## 📌 How to Contribute
9
+
10
+ 1. Open an Issue
11
+
12
+ - Have a question, bug report, or feature suggestion? [Open an issue](https://github.com/isaac-cf-wong/audioarxiv/issues/new/choose) and describe your idea clearly.
13
+ - Check for existing issues before opening a new one.
14
+
15
+ 2. Fork and Clone the Repository
16
+
17
+ ```shell
18
+ git clone git@github.com:<your-username>/audioarxiv.git
19
+ cd audioarxiv
20
+ ```
21
+
22
+ 3. Set Up Your Environment
23
+
24
+ We recommend using a virtual environment:
25
+
26
+ ```shell
27
+ python -m venv venv
28
+ source venv/bin/activate # on Windows: venv\Scripts\activate
29
+ pip install -e ".[dev]"
30
+ ```
31
+
32
+ 4. Set Up Pre-commit Hooks
33
+
34
+ We use pre-commit to ensure code quality and consistency. After installing dependencies, run:
35
+
36
+ ```shell
37
+ pre-commit install
38
+ ```
39
+
40
+ This ensures checks like code formatting, linting, and basic hygiene run automatically when you commit.
41
+
42
+ 5. Create a New Branch
43
+
44
+ Give it a meaningful name like fix-typo-in-docs or feature-add-summary-option.
45
+
46
+ 6. Make Changes
47
+
48
+ - Write clear, concise, and well-documented code.
49
+ - Follow [PEP 8](https://pep8.org/) style conventions.
50
+ - Add or update unit tests when applicable.
51
+
52
+ 7. Run Tests
53
+
54
+ Ensure that all tests pass before opening a pull request:
55
+
56
+ ```shell
57
+ pytest
58
+ ```
59
+
60
+ 8. Open a Pull Request
61
+
62
+ Clearly describe the motivation and scope of your change. Link it to the relevant issue if applicable.
63
+ The pull request titles should match the [Conventional Commits spec](https://www.conventionalcommits.org/).
64
+
65
+ ## 💡 Tips
66
+
67
+ - Be kind and constructive in your communication.
68
+ - Keep PRs focused and atomic—smaller changes are easier to review.
69
+ - Document new features and update existing docs if needed.
70
+ - Tag your PR with relevant labels if you can.
71
+
72
+ ## 📜 Licensing
73
+
74
+ By contributing, you agree that your contributions will be licensed under the project’s MIT License.
75
+
76
+ ---
77
+
78
+ Thanks again for being part of the audioarxiv community!
79
+
80
+ ---
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: audioarxiv
3
- Version: 0.1.2rc59.post1
3
+ Version: 0.1.2rc62.post1
4
4
  Summary: Turn arXiv papers into audio. audioarxiv lets you fetch the research papers from arXiv and read them aloud.
5
5
  Author-email: "Isaac C. F. Wong" <isaac.cf.wong@gmail.com>
6
6
  Requires-Python: >=3.9
@@ -22,6 +22,10 @@ Requires-Dist: sympy
22
22
  Requires-Dist: nltk
23
23
  Requires-Dist: pandas
24
24
  Requires-Dist: platformdirs
25
+ Requires-Dist: pytest ; extra == "dev"
26
+ Requires-Dist: pre-commit ; extra == "dev"
27
+ Requires-Dist: black ; extra == "dev"
28
+ Requires-Dist: flake8 ; extra == "dev"
25
29
  Requires-Dist: pyspark>=3.0.0 ; extra == "spark"
26
30
  Requires-Dist: bandit[toml]==1.8.3 ; extra == "test"
27
31
  Requires-Dist: black==25.1.0 ; extra == "test"
@@ -45,6 +49,7 @@ Project-URL: Homepage, https://github.com/isaac-cf-wong/audioarxiv
45
49
  Project-URL: Release Notes, https://github.com/isaac-cf-wong/audioarxiv/releases
46
50
  Project-URL: Source, https://github.com/isaac-cf-wong/audioarxiv
47
51
  Project-URL: Tracker, https://github.com/isaac-cf-wong/audioarxiv/issues
52
+ Provides-Extra: dev
48
53
  Provides-Extra: spark
49
54
  Provides-Extra: test
50
55
 
@@ -114,5 +119,15 @@ The settings are saved, so you only need to provide your preferred settings once
114
119
 
115
120
  ## Contributing
116
121
 
117
- This project welcomes contributions and suggestions. For details, visit the repository's [Contributor License Agreement (CLA)](https://cla.opensource.microsoft.com) and [Code of Conduct](https://opensource.microsoft.com/codeofconduct/) pages.
122
+ Contributions and suggestions are welcome! Whether it's fixing bugs, improving documentation, or adding new features, your help is appreciated.
123
+
124
+ Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before contributing.
125
+
126
+ To get started:
127
+
128
+ - Fork the repository
129
+ - Create a new branch for your changes
130
+ - Submit a pull request
131
+
132
+ If you're unsure where to begin, feel free to open an issue or ask for guidance!
118
133
 
@@ -64,4 +64,14 @@ The settings are saved, so you only need to provide your preferred settings once
64
64
 
65
65
  ## Contributing
66
66
 
67
- This project welcomes contributions and suggestions. For details, visit the repository's [Contributor License Agreement (CLA)](https://cla.opensource.microsoft.com) and [Code of Conduct](https://opensource.microsoft.com/codeofconduct/) pages.
67
+ Contributions and suggestions are welcome! Whether it's fixing bugs, improving documentation, or adding new features, your help is appreciated.
68
+
69
+ Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before contributing.
70
+
71
+ To get started:
72
+
73
+ - Fork the repository
74
+ - Create a new branch for your changes
75
+ - Submit a pull request
76
+
77
+ If you're unsure where to begin, feel free to open an issue or ask for guidance!
@@ -0,0 +1,36 @@
1
+ # Security Policy
2
+
3
+ We will support the latest stable release of `audioarxiv`. Please make sure you are using the most recent version before reporting a security issue.
4
+
5
+ | Version | Supported |
6
+ | ------- | --------- |
7
+ | 0.1.x | ✅ |
8
+ | < 0.1 | ❌ |
9
+
10
+ ## Reporting a Vulnerability
11
+
12
+ If you discover a security vulnerability in `audioarxiv`, we encourage you to report it responsibly.
13
+
14
+ **Please do not open a public issue.** Instead, contact us directly via email:
15
+
16
+ 📧 [isaac.cf.wong@gmail.com](mailto:isaac.cf.wong@gmail.com)
17
+
18
+ Include as much information as possible to help us understand and reproduce the issue quickly and accurately:
19
+
20
+ - Description of the vulnerability
21
+ - Steps to reproduce
22
+ - Affected versions
23
+ - Your operating system and Python version
24
+
25
+ We aim to respond to all security-related emails within **3–5 business days**.
26
+
27
+ ## Responsible Disclosure Process
28
+
29
+ 1. Submit the vulnerability report via email (see above).
30
+ 2. We will acknowledge receipt and begin investigation.
31
+ 3. We will work on a fix and prepare a patch release.
32
+ 4. Once the issue is resolved, we will publish an advisory and credit you (if desired).
33
+
34
+ ## Thanks
35
+
36
+ We value the security of our users and appreciate responsible disclosures. Thank you for helping make `audioarxiv` better and safer!
@@ -0,0 +1,29 @@
1
+ # Support
2
+
3
+ Thank you for your interest in **audioarxiv**!
4
+
5
+ If you have questions, suggestions, or need help using the project, here are some ways to get support:
6
+
7
+ ## 💬 Ask a Question
8
+
9
+ If you're experiencing a problem or have a question about how to use `audioarxiv`, please open a [GitHub Discussion](https://github.com/isaac-cf-wong/audioarxiv/discussions) or [Issue](https://github.com/isaac-cf-wong/audioarxiv/issues), depending on the nature of your question.
10
+
11
+ - Use **Discussions** for general questions, ideas, or usage help.
12
+ - Use **Issues** for reporting bugs or requesting new features.
13
+
14
+ ## 🐛 Found a Bug?
15
+
16
+ Please check if your issue has already been reported. If not, create a [new issue](https://github.com/isaac-cf-wong/audioarxiv/issues/new/choose) with:
17
+
18
+ - A clear and descriptive title.
19
+ - Steps to reproduce the problem.
20
+ - Relevant logs or error messages.
21
+ - The version of Python and `audioarxiv` you're using.
22
+
23
+ ## 🙋 Want to Contribute?
24
+
25
+ Contributions are welcome! Please check out the [Contributing Guide](CONTRIBUTING.md) and our [Code of Conduct](CODE_OF_CONDUCT.md) to get started.
26
+
27
+ ---
28
+
29
+ We appreciate your support and interest in the project!
@@ -0,0 +1,12 @@
1
+ coverage:
2
+ status:
3
+ project:
4
+ default:
5
+ target: auto # auto compares coverage to the previous base commit
6
+ comment: #this is a top-level key
7
+ layout: " diff, flags, files"
8
+ behavior: default
9
+ require_changes: false # if true: only post the comment if coverage changes
10
+ require_base: false # [true :: must have a base report to post]
11
+ require_head: true # [true :: must have a head report to post]
12
+ hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage]]
@@ -28,6 +28,9 @@
28
28
  "recarray",
29
29
  "punkt",
30
30
  "srepr",
31
- "fitz"
31
+ "fitz",
32
+ "caplog",
33
+ "venv",
34
+ "pytest",
32
35
  ]
33
36
  }
@@ -11,6 +11,8 @@ This page summarizes the key updates and changes in each release.
11
11
  Version 0.1.2 (2025-04-20)
12
12
  --------------------------
13
13
  - Update the LICENSE and the intended audience.
14
+ - Update text in SUPPORT.md, CODE_OF_CONDUCT.md, CONTRIBUTING.md, and SECURITY.md.
15
+ - Add more unit tests to increase coverage.
14
16
 
15
17
  **Full Changelog**: https://github.com/isaac-cf-wong/audioarxiv/compare/v0.1.1...v0.1.2
16
18
 
@@ -55,6 +55,12 @@ test = [
55
55
  "pytest-github-actions-annotate-failures",
56
56
  "shellcheck-py==0.10.0.1"
57
57
  ]
58
+ dev = [
59
+ "pytest",
60
+ "pre-commit",
61
+ "black",
62
+ "flake8"
63
+ ]
58
64
 
59
65
  [project.urls]
60
66
  Documentation = "https://isaac-cf-wong.github.io/audioarxiv"
@@ -24,7 +24,7 @@ from pandas import DataFrame
24
24
 
25
25
  from . import audio, preprocess, resources
26
26
 
27
- __version__ = "0.1.2-rc59-post1"
27
+ __version__ = "0.1.2-rc62-post1"
28
28
 
29
29
 
30
30
  def get_version_information() -> str:
@@ -43,6 +43,7 @@ def validate_audio_arguments(rate: float, volume: float, voice: int | str | None
43
43
  logger.error('Invalid voice ID = %s. Keeping current voice.', voice)
44
44
  elif voice is not None:
45
45
  logger.error('Unsupported datatype of voice = %s. It must be either int or str.', type(voice))
46
+ voice = None
46
47
  if pause_seconds < 0:
47
48
  pause_seconds = 0.1
48
49
  logger.error('pause = %s must be non-negative. Keeping the current pause.', pause_seconds)
@@ -172,6 +172,9 @@ class Paper:
172
172
  list: A list of sections. Each section is a dict with the header as the key and the content as the value.
173
173
  """
174
174
  if len(self._sections) == 0:
175
+ if self.paper is None:
176
+ logger.error('Paper is None. Cannot download PDF.')
177
+ return self._sections
175
178
  with tempfile.NamedTemporaryFile() as tmp:
176
179
  filename = tmp.name
177
180
  self.download_pdf(filename=filename)
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import logging
3
4
  from unittest.mock import MagicMock, patch
4
5
 
5
6
  import pytest
@@ -118,3 +119,83 @@ def test_list_voices(mock_init, mock_logger):
118
119
  audio.list_voices()
119
120
 
120
121
  mock_logger.info.assert_any_call("Index %s: %s (ID: %s)", 0, "Voice 1", "voice1")
122
+
123
+
124
+ def test_validate_audio_arguments_with_voice_index():
125
+ mock_voice = MagicMock()
126
+ mock_voice.id = "mock_voice_id"
127
+ with patch("pyttsx3.init") as mock_init:
128
+ mock_engine = MagicMock()
129
+ mock_engine.getProperty.return_value = [mock_voice]
130
+ mock_init.return_value = mock_engine
131
+
132
+ result = validate_audio_arguments(rate=140, volume=0.9, voice=0, pause_seconds=0.1)
133
+ assert result["voice"] == "mock_voice_id"
134
+
135
+
136
+ def test_validate_audio_arguments_with_invalid_voice_type(caplog):
137
+ with patch("pyttsx3.init") as mock_init:
138
+ mock_engine = MagicMock()
139
+ mock_engine.getProperty.return_value = None
140
+ mock_init.return_value = mock_engine
141
+
142
+ logger = logging.getLogger('audioarxiv') # Match the logger name
143
+ logger.setLevel(logging.ERROR) # Ensure ERROR logs are allowed
144
+ logger.propagate = True
145
+
146
+ # Capture logs at ERROR level
147
+ with caplog.at_level(logging.ERROR, logger='audioarxiv'):
148
+ result = validate_audio_arguments(rate=140,
149
+ volume=0.9,
150
+ voice=[], # type: ignore[argument]
151
+ pause_seconds=0.1)
152
+ print(caplog.text)
153
+ # Check if the log contains the expected error message
154
+ assert "Unsupported datatype of voice" in caplog.text
155
+ assert "<class 'list'>" in caplog.text # Optionally check for the actual type in the log message
156
+
157
+ # Ensure the result['voice'] is None
158
+ assert result['voice'] is None
159
+
160
+
161
+ def test_audio_sets_voice_property():
162
+ mock_voice = MagicMock()
163
+ mock_voice.id = "mock_voice_id"
164
+ with patch("pyttsx3.init") as mock_init:
165
+ mock_engine = MagicMock()
166
+ mock_engine.getProperty.return_value = [mock_voice]
167
+ mock_init.return_value = mock_engine
168
+
169
+ audio = Audio(voice="mock_voice_id") # noqa: F841
170
+ # Ensure setProperty was called with the correct voice ID
171
+ mock_engine.setProperty.assert_any_call("voice", "mock_voice_id")
172
+
173
+
174
+ @patch('audioarxiv.audio.base.pyttsx3.init') # control TTS engine
175
+ def test_read_article_with_non_string_input(mock_init, caplog):
176
+ mock_engine = MagicMock()
177
+ mock_init.return_value = mock_engine
178
+
179
+ logger = logging.getLogger('audioarxiv') # Match the logger name
180
+ logger.setLevel(logging.WARNING) # Ensure ERROR logs are allowed
181
+ logger.propagate = True
182
+
183
+ audio = Audio()
184
+ with caplog.at_level("WARNING"):
185
+ audio.read_article(article=12345) # type: ignore[argument]
186
+ assert "is not str. Skipping." in caplog.text
187
+
188
+
189
+ @patch('audioarxiv.audio.base.pyttsx3.init') # control TTS engine
190
+ def test_audio_stop(mock_init):
191
+ mock_engine = MagicMock()
192
+ mock_init.return_value = mock_engine # Ensure the mock engine is returned
193
+
194
+ # Create the Audio instance, which should use the mocked engine
195
+ audio = Audio()
196
+
197
+ # Call the stop method
198
+ audio.stop()
199
+
200
+ # Verify that the stop method was called on the mocked engine
201
+ mock_engine.stop.assert_called_once()
@@ -0,0 +1,183 @@
1
+ from __future__ import annotations
2
+
3
+ import logging
4
+ from datetime import datetime
5
+ from unittest.mock import MagicMock, patch
6
+
7
+ import pytest
8
+
9
+ from audioarxiv.resources.paper import ( # Replace with actual module name
10
+ Paper, validate_paper_arguments)
11
+
12
+
13
+ @pytest.fixture
14
+ def mock_paper_object():
15
+ mock_paper = MagicMock()
16
+ mock_paper.title = "Test Title"
17
+ mock_paper.summary = "This is a test abstract."
18
+
19
+ author1 = MagicMock()
20
+ author1.name = "Alice"
21
+ author2 = MagicMock()
22
+ author2.name = "Bob"
23
+ mock_paper.authors = [author1, author2]
24
+
25
+ mock_paper.published = datetime(2022, 1, 1)
26
+ mock_paper.updated = datetime(2022, 1, 2)
27
+ return mock_paper
28
+
29
+
30
+ @patch("audioarxiv.resources.paper.arxiv.Client")
31
+ def test_paper_init_and_client(mock_client_class):
32
+ paper = Paper(page_size=200, delay_seconds=5.0, num_retries=2)
33
+ client_instance = mock_client_class.return_value
34
+
35
+ assert paper.client == client_instance
36
+ mock_client_class.assert_called_with(page_size=200, delay_seconds=5.0, num_retries=2)
37
+
38
+
39
+ def test_validate_paper_arguments():
40
+ args = validate_paper_arguments(page_size=150, delay_seconds=2.0, num_retries=5)
41
+ assert args == {
42
+ 'page_size': 150,
43
+ 'delay_seconds': 2.0,
44
+ 'num_retries': 5
45
+ }
46
+
47
+
48
+ @patch("audioarxiv.resources.paper.arxiv.Client")
49
+ def test_search_by_arxiv_id_and_properties(mock_client_class, mock_paper_object):
50
+ mock_client = MagicMock()
51
+ mock_client.results.return_value = iter([mock_paper_object])
52
+ mock_client_class.return_value = mock_client
53
+
54
+ paper = Paper()
55
+ paper.search_by_arxiv_id("1234.5678")
56
+
57
+ assert paper.title == "Test Title"
58
+ assert paper.abstract == "This is a test abstract."
59
+ assert paper.authors == ["Alice", "Bob"]
60
+ assert paper.published == datetime(2022, 1, 1)
61
+ assert paper.updated == datetime(2022, 1, 2)
62
+
63
+
64
+ @patch("audioarxiv.resources.paper.arxiv.Client")
65
+ def test_init_without_validation(mock_client_class):
66
+ paper = Paper(validate_arguments=False) # noqa: F841 # pylint: disable=unused-variable
67
+ mock_client_class.assert_called_once()
68
+
69
+
70
+ @patch("audioarxiv.resources.paper.arxiv.Client")
71
+ def test_paper_properties_when_paper_is_none(mock_client_class, caplog):
72
+ mock_client = MagicMock()
73
+ mock_client_class.return_value = mock_client
74
+
75
+ logger = logging.getLogger('audioarxiv') # Match the logger name
76
+ logger.setLevel(logging.ERROR) # Ensure ERROR logs are allowed
77
+ logger.propagate = True
78
+
79
+ paper = Paper()
80
+
81
+ with caplog.at_level(logging.ERROR, logger='audioarxiv'):
82
+ assert paper.title is None
83
+ assert 'paper is None.' in caplog.text
84
+ with caplog.at_level(logging.ERROR, logger='audioarxiv'):
85
+ assert paper.abstract is None
86
+ assert 'paper is None.' in caplog.text
87
+ with caplog.at_level(logging.ERROR, logger='audioarxiv'):
88
+ assert paper.authors is None
89
+ assert 'paper is None.' in caplog.text
90
+ with caplog.at_level(logging.ERROR, logger='audioarxiv'):
91
+ assert paper.published is None
92
+ assert 'paper is None.' in caplog.text
93
+ with caplog.at_level(logging.ERROR, logger='audioarxiv'):
94
+ assert paper.updated is None
95
+ assert 'paper is None.' in caplog.text
96
+
97
+
98
+ @patch("audioarxiv.resources.paper.arxiv.Client")
99
+ def test_download_pdf_with_valid_paper(mock_client_class, mock_paper_object):
100
+ mock_client = MagicMock()
101
+ mock_client.results.return_value = iter([mock_paper_object])
102
+ mock_client_class.return_value = mock_client
103
+
104
+ mock_paper_object.download_pdf.return_value = "path/to/pdf"
105
+
106
+ # Create the Paper instance
107
+ paper = Paper(validate_arguments=False)
108
+ paper.search_by_arxiv_id('arxiv_id')
109
+
110
+ # Call the `download_pdf` method
111
+ pdf_path = paper.download_pdf(dirpath='./', filename='test_paper.pdf')
112
+
113
+ # Assertions
114
+ mock_paper_object.download_pdf.assert_called_once_with(dirpath='./', filename='test_paper.pdf')
115
+ assert pdf_path == "path/to/pdf"
116
+
117
+
118
+ @patch("audioarxiv.resources.paper.arxiv.Client")
119
+ def test_download_pdf_when_no_paper(mock_client_class, caplog):
120
+ mock_client = MagicMock()
121
+ mock_client_class.return_value = mock_client
122
+
123
+ logger = logging.getLogger('audioarxiv') # Match the logger name
124
+ logger.setLevel(logging.ERROR) # Ensure ERROR logs are allowed
125
+ logger.propagate = True
126
+
127
+ # Setup: Create Paper instance with no paper assigned
128
+ paper = Paper(validate_arguments=False)
129
+
130
+ with caplog.at_level(logging.ERROR, logger='audioarxiv'):
131
+ # Call `download_pdf`
132
+ pdf_path = paper.download_pdf(dirpath='./', filename='test_paper.pdf')
133
+
134
+ # Assertions
135
+ assert pdf_path is None
136
+ assert 'Paper is None. Cannot download PDF.' in caplog.text
137
+
138
+
139
+ @patch("audioarxiv.resources.paper.arxiv.Client")
140
+ def test_sections_with_valid_pdf(mock_client_class, mock_paper_object):
141
+ mock_client = MagicMock()
142
+ mock_client.results.return_value = iter([mock_paper_object])
143
+ mock_client_class.return_value = mock_client
144
+
145
+ # Setup: Create Paper instance with no paper assigned
146
+ paper = Paper(validate_arguments=False)
147
+ paper.search_by_arxiv_id('arxiv_id')
148
+
149
+ # Mock the `download_pdf` and `fitz.open` methods
150
+ with patch('fitz.open') as mock_fitz_open:
151
+ mock_page = MagicMock()
152
+ mock_page.get_text.return_value = [[None, None, None, None, "SECTION HEADER\n"],
153
+ [None, None, None, None, "Section Content"]]
154
+ mock_fitz_open.return_value = [mock_page]
155
+
156
+ # Call the `sections` property
157
+ sections = paper.sections
158
+
159
+ # Assertions
160
+ assert len(sections) > 0 # Should return at least one section
161
+ assert sections[0]["header"] == "SECTION HEADER"
162
+ assert "Section Content" in sections[0]["content"]
163
+
164
+
165
+ @patch("audioarxiv.resources.paper.arxiv.Client")
166
+ def test_sections_when_no_paper(mock_client_class, caplog):
167
+ mock_client = MagicMock()
168
+ mock_client_class.return_value = mock_client
169
+
170
+ logger = logging.getLogger('audioarxiv') # Match the logger name
171
+ logger.setLevel(logging.ERROR) # Ensure ERROR logs are allowed
172
+ logger.propagate = True
173
+
174
+ # Setup: Create Paper instance with no paper assigned
175
+ paper = Paper(validate_arguments=False)
176
+
177
+ with caplog.at_level(logging.ERROR, logger='audioarxiv'):
178
+ # Call `sections` property
179
+ sections = paper.sections
180
+
181
+ # Assertions
182
+ assert 'Paper is None. Cannot download PDF.' in caplog.text
183
+ assert len(sections) == 0 # No sections should be found since paper is None
@@ -1,9 +0,0 @@
1
- # Microsoft Open Source Code of Conduct
2
-
3
- This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4
-
5
- Resources:
6
-
7
- - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8
- - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9
- - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
@@ -1,7 +0,0 @@
1
- # Support
2
-
3
- ## How to file issues and get help
4
-
5
- This project uses GitHub Issues to track bugs and feature requests. Please search the existing
6
- issues before filing new issues to avoid duplicates. For new issues, file your bug or
7
- feature request as a new Issue.
@@ -1,66 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from datetime import datetime
4
- from unittest.mock import MagicMock, patch
5
-
6
- import pytest
7
-
8
- from audioarxiv.resources.paper import ( # Replace with actual module name
9
- Paper, validate_paper_arguments)
10
-
11
-
12
- @pytest.fixture
13
- def mock_paper_object():
14
- mock_paper = MagicMock()
15
- mock_paper.title = "Test Title"
16
- mock_paper.summary = "This is a test abstract."
17
-
18
- author1 = MagicMock()
19
- author1.name = "Alice"
20
- author2 = MagicMock()
21
- author2.name = "Bob"
22
- mock_paper.authors = [author1, author2]
23
-
24
- mock_paper.published = datetime(2022, 1, 1)
25
- mock_paper.updated = datetime(2022, 1, 2)
26
- return mock_paper
27
-
28
-
29
- @patch("audioarxiv.resources.paper.arxiv.Client")
30
- def test_paper_init_and_client(mock_client_class):
31
- paper = Paper(page_size=200, delay_seconds=5.0, num_retries=2)
32
- client_instance = mock_client_class.return_value
33
-
34
- assert paper.client == client_instance
35
- mock_client_class.assert_called_with(page_size=200, delay_seconds=5.0, num_retries=2)
36
-
37
-
38
- def test_validate_paper_arguments():
39
- args = validate_paper_arguments(page_size=150, delay_seconds=2.0, num_retries=5)
40
- assert args == {
41
- 'page_size': 150,
42
- 'delay_seconds': 2.0,
43
- 'num_retries': 5
44
- }
45
-
46
-
47
- @patch("audioarxiv.resources.paper.arxiv.Client")
48
- def test_search_by_arxiv_id_and_properties(mock_client_class, mock_paper_object):
49
- mock_client = MagicMock()
50
- mock_client.results.return_value = iter([mock_paper_object])
51
- mock_client_class.return_value = mock_client
52
-
53
- paper = Paper()
54
- paper.search_by_arxiv_id("1234.5678")
55
-
56
- assert paper.title == "Test Title"
57
- assert paper.abstract == "This is a test abstract."
58
- assert paper.authors == ["Alice", "Bob"]
59
- assert paper.published == datetime(2022, 1, 1)
60
- assert paper.updated == datetime(2022, 1, 2)
61
-
62
-
63
- @patch("audioarxiv.resources.paper.arxiv.Client")
64
- def test_init_without_validation(mock_client_class):
65
- paper = Paper(validate_arguments=False) # noqa: F841 # pylint: disable=unused-variable
66
- mock_client_class.assert_called_once()