Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.8'
cache: 'pip'
- name: Install dependencies
run: |
Expand Down
33 changes: 32 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.8'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Incompatibility with Python 3.8 detected.

The dependencies sphinx-autobuild and sphinx require Python >= 3.9, which means they are not compatible with Python 3.8. Therefore, updating the GitHub Actions workflow to use Python 3.8 will lead to compatibility issues.

  • sphinx-autobuild requires Python >= 3.9
  • sphinx requires Python >= 3.9

Please update the Python version in the GitHub Actions workflow to a compatible version (e.g., Python 3.9 or higher).

Analysis chain

Updated Python version in GitHub Actions workflows.

The Python version has been updated to 3.8. Verify that all dependencies and scripts are compatible with this version to avoid runtime issues.

Also applies to: 48-48

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify Python 3.8 compatibility with all dependencies.

# Test: Check for any Python version-specific deprecations or compatibility issues in the codebase.
grep -r "python_version" . --include=*.py

Length of output: 43



Script:

#!/bin/bash
# Description: Verify Python 3.8 compatibility with all dependencies.

# Step 1: Find all requirements files.
requirements_files=$(find . -name "requirements*.txt")

# Step 2: List all dependencies from the requirements files.
echo "Dependencies found in requirements files:"
for file in $requirements_files; do
    echo "File: $file"
    cat "$file"
done

# Step 3: Check if any dependencies have known compatibility issues with Python 3.8.
# Note: This is a basic check and may need manual verification for complete assurance.
echo "Checking compatibility of dependencies with Python 3.8..."
for file in $requirements_files; do
    while IFS= read -r line; do
        package=$(echo $line | awk '{print $1}')
        pip show "$package" | grep "Requires-Python"
    done < "$file"
done

Length of output: 2053



Script:

#!/bin/bash
# Description: Verify Python 3.8 compatibility with all dependencies using PyPI metadata.

# Step 1: Find all requirements files.
requirements_files=$(find . -name "requirements*.txt")

# Step 2: List all dependencies from the requirements files.
echo "Dependencies found in requirements files:"
for file in $requirements_files; do
    echo "File: $file"
    cat "$file"
done

# Step 3: Check if any dependencies have known compatibility issues with Python 3.8 using PyPI metadata.
echo "Checking compatibility of dependencies with Python 3.8 from PyPI..."
for file in $requirements_files; do
    while IFS= read -r line; do
        package=$(echo $line | awk '{print $1}')
        echo "Checking $package..."
        curl -s "https://pypi.org/pypi/$package/json" | jq '.info.requires_python'
    done < "$file"
done

Length of output: 2273

cache: 'pip'
- name: Install dependencies
run: |
Expand All @@ -36,3 +36,34 @@ jobs:
files: |
LICENSE.txt
dist/**
prerelease:
name: "Creating Pre-release"
runs-on: ubuntu-latest
if: "contains(github.ref, 'dev')" # for 'dev' tags
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch

- name: Build package
run: make package

- name: Debug Ref
run: |
echo "GitHub ref: ${GITHUB_REF}"

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
automatic_release_tag: "Pre-release"
files: |
LICENSE.txt
dist/**
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Please Contribute to this project by forking [hckr](https://github.com/pateash/h

Please feel free to provide any suggestion for new utility in [Issues](https://github.com/pateash/hckr/issues)

## Python
* Use python3.8 in development

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider changing the list marker style for consistency.

Markdownlint flagged the use of asterisks for list items. Consider using dashes for list items to maintain consistency throughout the document.

- * Use python3.8 in development
+ - Use python3.8 in development
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* Use python3.8 in development
- Use python3.8 in development
Tools
Markdownlint

16-16: Expected: dash; Actual: asterisk
Unordered list style

(MD004, ul-style)


16-16: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


## Publishing to Pypi
* Once we publish a release, Publish workflow [publish.yml](.github%2Fworkflows%2Fpublish.yml) automatically publishes a version to [PyPi](https://pypi.org/p/hckr)
workflow will automatically create next tag using dynamic version defined in [__about__.py](src%2Fhckr%2F__about__.py)
Expand All @@ -29,3 +32,4 @@ pre-commit install
```shell
make pypi-clean
```

5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ env-show :
hatch env show

hatch-docs-deps-sync:
python docs/hatch-env-docs-requirements-sync.py
hatch run docs:docs-deps

# this will sync the dependencies automatically
sync-default:
hatch run default:deps
sync-dev:
hatch run dev:deps
sync-docs:
hatch run docs:deps

sync : hatch-docs-deps-sync sync-default sync-dev sync-docs
sync : sync-default sync-dev sync-docs hatch-docs-deps-sync
echo "DONE.\n=========================="

# install cli in local for testing, change code an it will be automatically reflected in UI
Expand Down
3 changes: 2 additions & 1 deletion docs/hatch-env-docs-requirements-sync.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import tomli


# this is needed as we want to use hatch.docs env for all doc dependencies
# but readthedocs can't use hatch env and we have to either provide setup.py or requirement.txt
# using this script we are syncing requirements.txt from docs dependencies automatically
Expand All @@ -16,7 +17,7 @@ def generate_requirements(hatch_env='docs'):

# Extract dependencies for the specific Hatch environment
dependencies = toml_data.get('tool', {}).get('hatch', {}).get('envs', {}).get(hatch_env, {}).get('dependencies',
[])
[])

# Write dependencies to requirements.txt
if dependencies:
Expand Down
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ sphinx-click
shibuya
sphinx-notfound-page
sphinx-copybutton
tomli
12 changes: 4 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,19 @@ dependencies = [
"pyarrow", # For saving data in Parquet format.
"fastavro", # For handling Avro file format.
"requests",
"tomli"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Re-evaluate the necessity of tomli in core dependencies.

The tomli package is used in a script (docs/hatch-env-docs-requirements-sync.py) that is part of the documentation build process. It is not essential for the core functionality of the project. Consider moving tomli to a specific section for documentation dependencies to keep the core dependencies clean.

  • docs/hatch-env-docs-requirements-sync.py: Uses tomli for syncing documentation dependencies.
Analysis chain

Verify the re-addition of tomli in dependencies.

The tomli package has been added back to the dependencies. According to the summary, it was removed from one section and added to another. Ensure that this re-addition is intentional and necessary for the project's functionality with Python 3.8.


Verify the purpose of docs/hatch-env-docs-requirements-sync.py to confirm tomli necessity.

The tomli package is used in docs/hatch-env-docs-requirements-sync.py. To determine if tomli is crucial for the project's functionality with Python 3.8 or if it is used for documentation purposes, we need to understand the role of this script.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the necessity of `tomli` in dependencies.

# Test: Search for `tomli` usage in the project. Expect: References to `tomli` usage.
rg --type py 'tomli'

Length of output: 161



Script:

#!/bin/bash
# Description: Verify the purpose of `docs/hatch-env-docs-requirements-sync.py`.

# Output the first 20 lines of the file to understand its purpose.
head -n 20 docs/hatch-env-docs-requirements-sync.py

Length of output: 952

]

[project.urls]
Documentation = "https://hckr.readthedocs.io"
Issues = "https://github.com/pateash/hckr/issues"
Source = "https://github.com/pateash/hckr"

[tool.hatch.env]
requires = [
"hatch-pip-compile"
]
# to make sure the default env is in same repo ( for Intellij to refer )
[tool.hatch.envs.default]
type = "pip-compile"
type = "virtual"
path = "venv"
# using hatch-pip-compile to generate requirements hashes for depandabot
pip-compile-hashes = true
python = "python3.8"

[tool.hatch.envs.default.scripts]
deps = "echo 'Syncing Default Dependencies\n=========================='"
Expand Down Expand Up @@ -122,9 +118,9 @@ dependencies = [
"shibuya",
"sphinx-notfound-page",
"sphinx-copybutton",
"tomli"
]
[tool.hatch.envs.docs.scripts]
# --pre-build makes sure we get latest changes even if we modify something in
docs = "sphinx-autobuild -a --port=0 --open-browser docs/source docs/build --watch src/hckr --pre-build 'rm -rf docs/build'"
deps = "echo 'Syncing Docs Dependencies\n============='"
docs-deps = "python docs/hatch-env-docs-requirements-sync.py"
Loading