Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Minor bug fixes #32

Merged
merged 3 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8",
"editor.formatOnSave": true,
"editor.formatOnSave": true
},
"python.formatting.provider": "autopep8",
"cSpell.words": ["figlet", "KHTML", "pyfiglet"]
"cSpell.words": ["figlet", "KHTML", "pyfiglet", "wpdetect"]
}
17 changes: 17 additions & 0 deletions install-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

<<EOF
This script is used to install the package from source for testing purposes.
EOF

# Find the python executable
python_executable=$(which python)
if [ -z "$python_executable" ]; then
python_executable=$(which python3)
fi

$python_executable -m pip install --upgrade build
$python_executable -m build

pip uninstall wpdetect -y
pip install dist/wpdetect-*-py3-none-any.whl
2 changes: 2 additions & 0 deletions release-tag.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

# This script is used to tag a release of the package.

echo "Running release-tag.sh"

# Ensure we're on the master branch
Expand Down
6 changes: 2 additions & 4 deletions wpdetect/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
'''

import sys
import os
import urllib.request
from urllib.parse import urlparse
import toml
Expand Down Expand Up @@ -33,9 +32,8 @@
def get_package_version():
"""Returns the version of the package."""

file_path = os.path.join(os.path.dirname(__file__), '..', 'pyproject.toml')

with open(file_path, 'r', encoding="utf-8") as pyproject_toml_file:
# using absolute path to open the file because of the issue: #31
with open('pyproject.toml', 'r', encoding="utf-8") as pyproject_toml_file:
config = toml.load(pyproject_toml_file)

return config['project']['version']
Expand Down