Skip to content

Commit

Permalink
Maintenance updates
Browse files Browse the repository at this point in the history
* Update to 3.12 in .python-version, Dockerfile, and Pipfile
* Add help command to Makefile
* Update and reorder dependencies in Pipfile
* Update pyproject.toml
  • Loading branch information
ehanson8 committed Sep 10, 2024
1 parent 50b8009 commit 1839201
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11
3.12
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ RUN apt-get update \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update

# Install Python 3.11
RUN apt-get install -y python3.11 python3.11-venv python3.11-dev
# Install Python
RUN apt-get install -y python3.12 python3.12-venv python3.12-dev

# Install pip for Python 3.11
# Install pip for Python
RUN apt-get install -y python3-pip

# Upgrade pip and install pipenv
Expand All @@ -28,7 +28,7 @@ RUN pip3 install --upgrade pip \
# Setup python virtual environment
WORKDIR /browsertrix-harvester
COPY Pipfile /browsertrix-harvester/Pipfile
RUN pipenv install --python 3.11
RUN pipenv install --python 3.12

# Copy full browstrix-harvester app
COPY pyproject.toml /browsertrix-harvester/
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ ECR_URL_DEV:=222053980223.dkr.ecr.us-east-1.amazonaws.com/browsertrix-harvester-
SHELL=/bin/bash
DATETIME:=$(shell date -u +%Y%m%dT%H%M%SZ)

help: ## Print this message
@awk 'BEGIN { FS = ":.*##"; print "Usage: make <target>\n\nTargets:" } \
/^[-_[:alpha:]]+:.?*##/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)

### Dependency commands ###
install: # install python dependencies
pipenv install --dev
Expand Down
16 changes: 8 additions & 8 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ verify_ssl = true
name = "pypi"

[packages]
bs4 = "*"
click = "*"
sentry-sdk = "*"
warcio = "*"
requests = "*"
pandas = "*"
bs4 = "*"
requests = "*"
sentry-sdk = "*"
smart-open = {version = "*", extras = ["s3"]}
warcio = "*"
yake = "*"

[dev-packages]
black = "*"
coverage = "*"
coveralls = "*"
ipython = "*"
mypy = "*"
pandas-stubs = "*"
pre-commit = "*"
pytest = "*"
ruff = "*"
safety= "*"
pre-commit = "*"
ipython = "*"
types-beautifulsoup4 = "*"
pandas-stubs = "*"

[requires]
python_version = "3.11"
python_version = "3.12"

[scripts]
harvester = "python -c \"from harvester.cli import main; main()\""
Expand Down
33 changes: 20 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ markers = [
]

[tool.ruff]
target-version = "py311"
target-version = "py312"

# set max line length
line-length = 90

# enumerate all fixed violations
show-fixes = true

[tool.ruff.lint]
select = ["ALL", "PT"]

ignore = [
Expand All @@ -35,6 +43,7 @@ ignore = [
"D103",
"D104",
"D415",
"G004",
"PLR0912",
"PLR0913",
"PLR0915",
Expand All @@ -47,23 +56,21 @@ ignore = [
# allow autofix behavior for specified rules
fixable = ["E", "F", "I", "Q"]

# set max line length
line-length = 90

# enumerate all fixed violations
show-fixes = true

[tool.ruff.flake8-annotations]
[tool.ruff.lint.flake8-annotations]
mypy-init-return = true

[tool.ruff.flake8-pytest-style]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false

[tool.ruff.per-file-ignores]
"tests/**/*" = ["ANN", "ARG001", "S101"]
[tool.ruff.lint.per-file-ignores]
"tests/**/*" = [
"ANN",
"ARG001",
"S101",
]

[tool.ruff.pycodestyle]
[tool.ruff.lint.pycodestyle]
max-doc-length = 90

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "google"

0 comments on commit 1839201

Please sign in to comment.