mirror of https://github.com/Bunsly/JobSpy
Compare commits
5 Commits
d52e366ef7
...
04032a0f91
Author | SHA1 | Date |
---|---|---|
github-actions | 04032a0f91 | |
Cullen Watson | 496896d0b5 | |
Cullen Watson | 87ba1ad1bf | |
Jason Geffner | 4e7ac9a583 | |
Cullen Watson | e44d13e1cf |
|
@ -1,33 +1,50 @@
|
||||||
name: Publish Python 🐍 distributions 📦 to PyPI
|
name: Publish Python 🐍 distributions 📦 to PyPI
|
||||||
on: push
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- closed
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-n-publish:
|
build-n-publish:
|
||||||
name: Build and publish Python 🐍 distributions 📦 to PyPI
|
name: Build and publish Python 🐍 distributions 📦 to PyPI
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pip install toml
|
||||||
|
|
||||||
|
- name: Increment version
|
||||||
|
run: python increment_version.py
|
||||||
|
|
||||||
|
- name: Commit version increment
|
||||||
|
run: |
|
||||||
|
git config --global user.name 'github-actions'
|
||||||
|
git config --global user.email 'github-actions@github.com'
|
||||||
|
git add pyproject.toml
|
||||||
|
git commit -m 'Increment version'
|
||||||
|
|
||||||
|
- name: Push changes
|
||||||
|
run: git push
|
||||||
|
|
||||||
- name: Install poetry
|
- name: Install poetry
|
||||||
run: >-
|
run: pip install poetry --user
|
||||||
python3 -m
|
|
||||||
pip install
|
|
||||||
poetry
|
|
||||||
--user
|
|
||||||
|
|
||||||
- name: Build distribution 📦
|
- name: Build distribution 📦
|
||||||
run: >-
|
run: poetry build
|
||||||
python3 -m
|
|
||||||
poetry
|
|
||||||
build
|
|
||||||
|
|
||||||
- name: Publish distribution 📦 to PyPI
|
- name: Publish distribution 📦 to PyPI
|
||||||
if: startsWith(github.ref, 'refs/tags')
|
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
with:
|
with:
|
||||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@ -0,0 +1,21 @@
|
||||||
|
import toml
|
||||||
|
|
||||||
|
def increment_version(version):
|
||||||
|
major, minor, patch = map(int, version.split('.'))
|
||||||
|
patch += 1
|
||||||
|
return f"{major}.{minor}.{patch}"
|
||||||
|
|
||||||
|
# Load pyproject.toml
|
||||||
|
with open('pyproject.toml', 'r') as file:
|
||||||
|
pyproject = toml.load(file)
|
||||||
|
|
||||||
|
# Increment the version
|
||||||
|
current_version = pyproject['tool']['poetry']['version']
|
||||||
|
new_version = increment_version(current_version)
|
||||||
|
pyproject['tool']['poetry']['version'] = new_version
|
||||||
|
|
||||||
|
# Save the updated pyproject.toml
|
||||||
|
with open('pyproject.toml', 'w') as file:
|
||||||
|
toml.dump(pyproject, file)
|
||||||
|
|
||||||
|
print(f"Version updated from {current_version} to {new_version}")
|
|
@ -1,2 +0,0 @@
|
||||||
[virtualenvs]
|
|
||||||
in-project = true
|
|
|
@ -1,15 +1,21 @@
|
||||||
|
[build-system]
|
||||||
|
requires = [ "poetry-core",]
|
||||||
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "python-jobspy"
|
name = "python-jobspy"
|
||||||
version = "1.1.75"
|
version = "1.1.76"
|
||||||
description = "Job scraper for LinkedIn, Indeed, Glassdoor & ZipRecruiter"
|
description = "Job scraper for LinkedIn, Indeed, Glassdoor & ZipRecruiter"
|
||||||
authors = ["Zachary Hampton <zachary@bunsly.com>", "Cullen Watson <cullen@bunsly.com>"]
|
authors = [ "Zachary Hampton <zachary@bunsly.com>", "Cullen Watson <cullen@bunsly.com>",]
|
||||||
homepage = "https://github.com/Bunsly/JobSpy"
|
homepage = "https://github.com/Bunsly/JobSpy"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
keywords = ['jobs-scraper', 'linkedin', 'indeed', 'glassdoor', 'ziprecruiter']
|
keywords = [ "jobs-scraper", "linkedin", "indeed", "glassdoor", "ziprecruiter",]
|
||||||
|
[[tool.poetry.packages]]
|
||||||
|
include = "jobspy"
|
||||||
|
from = "src"
|
||||||
|
|
||||||
packages = [
|
[tool.black]
|
||||||
{ include = "jobspy", from = "src" }
|
line-length = 88
|
||||||
]
|
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.10"
|
python = "^3.10"
|
||||||
|
@ -22,16 +28,8 @@ tls-client = "^1.0.1"
|
||||||
markdownify = "^0.13.1"
|
markdownify = "^0.13.1"
|
||||||
regex = "^2024.4.28"
|
regex = "^2024.4.28"
|
||||||
|
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
pytest = "^7.4.1"
|
pytest = "^7.4.1"
|
||||||
jupyter = "^1.0.0"
|
jupyter = "^1.0.0"
|
||||||
black = "*"
|
black = "*"
|
||||||
pre-commit = "*"
|
pre-commit = "*"
|
||||||
|
|
||||||
[build-system]
|
|
||||||
requires = ["poetry-core"]
|
|
||||||
build-backend = "poetry.core.masonry.api"
|
|
||||||
|
|
||||||
[tool.black]
|
|
||||||
line-length = 88
|
|
||||||
|
|
|
@ -232,7 +232,7 @@ class GoogleJobsScraper(Scraper):
|
||||||
def _find_job_info_initial_page(html_text: str):
|
def _find_job_info_initial_page(html_text: str):
|
||||||
pattern = (
|
pattern = (
|
||||||
f'520084652":('
|
f'520084652":('
|
||||||
+ r"\[(?:[^\[\]]|\[(?:[^\[\]]|\[(?:[^\[\]]|\[[^\[\]]*\])*\])*\])*\])"
|
+ r"\[.*?\]\s*])\s*}\s*]\s*]\s*]\s*]\s*]"
|
||||||
)
|
)
|
||||||
results = []
|
results = []
|
||||||
matches = re.finditer(pattern, html_text)
|
matches = re.finditer(pattern, html_text)
|
||||||
|
|
Loading…
Reference in New Issue