Skip to content

Commit

Permalink
remove the superlinter. never worked anyways
Browse files Browse the repository at this point in the history
  • Loading branch information
calebjcourtney committed Apr 15, 2024
1 parent e76c42a commit 79cd222
Show file tree
Hide file tree
Showing 55 changed files with 975 additions and 924 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/superlinter.yml

This file was deleted.

83 changes: 83 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
default_language_version:
node: 13.8.0
python: python3.10

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: check-toml
- id: check-case-conflict
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- id: check-symlinks
- id: check-yaml
args: [--unsafe]
- id: debug-statements
- id: detect-private-key

- repo: https://github.com/adrienverge/yamllint
rev: v1.26.3
hooks:
- id: yamllint
args: [-d, relaxed]

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.1.1
hooks:
- id: yamlfmt
args: [--mapping, '2', --sequence, '4', --offset, '2']
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.3.5
hooks:
- id: reorder-python-imports
args:
- --application-directories=api

- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
additional_dependencies: [click==8.0.3]

- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies: &flake8-deps
- flake8-formatter-abspath==1.0.1
- flake8-fixme==1.1.1
- flake8-isort==4.0.0
- flake8-unused-arguments==0.0.6
- flake8-use-fstring==1.1

- repo: https://github.com/PyCQA/pylint
rev: v2.9.6
hooks:
- id: pylint
exclude: migrations
args:
- --extension-pkg-whitelist=math
- --extension-pkg-whitelist=requests
- --extension-pkg-whitelist=pandas

- repo: https://github.com/asottile/yesqa
rev: v1.2.3
hooks:
- id: yesqa
additional_dependencies: *flake8-deps

- repo: https://github.com/pycqa/bandit
rev: 1.7.0
hooks:
- id: bandit
args: [-iii, -ll]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
hooks:
- id: mypy
additional_dependencies: [types-all]
69 changes: 48 additions & 21 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Check if users have all the dependencies required
# If they installed from the requirements.txt file correctly, this should not raise an error
from __future__ import annotations

from .apis.acsIndicators import ACSIndicatorsConnection
from .apis.aggregateProfiles import AggregateProfilesConnection
from .apis.automationIndex import AutomationIndexConnection
from .apis.base import EmsiBaseConnection
from .apis.canadaPostings import CanadaPostingsConnection
from .apis.companies import CompaniesConnection
from .apis.coreLmi import CoreLMIConnection
from .apis.emsiTitles import TitlesConnection
from .apis.geography import GeographyConnection
from .apis.globalPostings import GlobalPostingsConnection
from .apis.globalProfiles import GlobalProfilesConnection
from .apis.ipeds import IpedsConnection
from .apis.openSkills import SkillsClassificationConnection
from .apis.talentBenchmark import TalentBenchmarkConnection
from .apis.unitedKingdomPostings import UKPostingsConnection
from .apis.unitedKingdomProfiles import UKProfiles
from .apis.usCompensation import UsCompensationConnection
from .apis.usInputOutput import USInputOutputConncetion
from .apis.usOccEarnings import UsOccupationEarningsConnection
from .apis.usPostings import UnitedStatesPostingsConnection

hard_dependencies = ("requests", "pandas")
missing_dependencies = []

Expand All @@ -11,28 +34,32 @@

if missing_dependencies:
raise ImportError(
"Unable to import required dependencies:\n" + "\n".join(missing_dependencies)
"Unable to import required dependencies:\n"
+ "\n".join(missing_dependencies),
)
del hard_dependencies, dependency, missing_dependencies

# import all of the apis that we have connections defined for up to this point
from .apis.base import EmsiBaseConnection
from .apis.automationIndex import AutomationIndexConnection
from .apis.aggregateProfiles import AggregateProfilesConnection
from .apis.canadaPostings import CanadaPostingsConnection
from .apis.coreLmi import CoreLMIConnection
from .apis.usPostings import UnitedStatesPostingsConnection
from .apis.acsIndicators import ACSIndicatorsConnection
from .apis.openSkills import SkillsClassificationConnection
from .apis.emsiTitles import EmsiTitlesConnection
from .apis.usCompensation import UsCompensationConnection
from .apis.usOccEarnings import UsOccupationEarningsConnection
from .apis.usInputOutput import USInputOutputConncetion
from .apis.geography import GeographyConnection
from .apis.ipeds import IpedsConnection
from .apis.unitedKingdomPostings import UKPostingsConnection
from .apis.talentBenchmark import TalentBenchmarkConnection
from .apis.globalPostings import GlobalPostingsConnection
from .apis.globalProfiles import GlobalProfilesConnection
from .apis.companies import CompaniesConnection
from .apis.unitedKingdomProfiles import UKProfiles

__all__ = [
"ACSIndicatorsConnection",
"AggregateProfilesConnection",
"AutomationIndexConnection",
"EmsiBaseConnection",
"CanadaPostingsConnection",
"CompaniesConnection",
"CoreLMIConnection",
"TitlesConnection",
"GeographyConnection",
"GlobalPostingsConnection",
"GlobalProfilesConnection",
"IpedsConnection",
"SkillsClassificationConnection",
"TalentBenchmarkConnection",
"UKPostingsConnection",
"UKProfiles",
"UsCompensationConnection",
"USInputOutputConncetion",
"UsOccupationEarningsConnection",
"UnitedStatesPostingsConnection",
]
5 changes: 3 additions & 2 deletions apis/acsIndicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
https://api.emsidata.com/apis/emsi-acs-indicators
"""
from __future__ import annotations

from .base import EmsiBaseConnection

Expand All @@ -27,7 +28,7 @@ def __init__(self) -> None:

self.name = "ACS"

def get_metrics(self, metric_name: str = None) -> dict:
def get_metrics(self, metric_name: str | None = None) -> dict:
"""
Summary
Expand All @@ -40,7 +41,7 @@ def get_metrics(self, metric_name: str = None) -> dict:
if metric_name is None:
response = self.download_data("meta/metrics")
else:
response = self.download_data("meta/metrics/{}".format(metric_name))
response = self.download_data(f"meta/metrics/{metric_name}")

return response.json()["data"]

Expand Down
2 changes: 2 additions & 0 deletions apis/aggregateProfiles.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
The following is taken from Emsi's documentation, available here: https://api.emsidata.com/apis/aggregate-profile-data
"""
from __future__ import annotations

from .base import ProfilesConnection


Expand Down
12 changes: 8 additions & 4 deletions apis/automationIndex.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
https://api.emsidata.com/apis/automation-index
"""
from __future__ import annotations

from .base import EmsiBaseConnection


Expand Down Expand Up @@ -63,7 +65,7 @@ def get_metadata(self, nation="us"):
Returns:
TYPE: Description
"""
api_endpoint = "/{}/meta".format(nation)
api_endpoint = f"/{nation}/meta"
response = self.download_data(api_endpoint)

return response.json()["data"]
Expand All @@ -77,7 +79,7 @@ def get_index(self, nation="us"):
Returns:
TYPE: Description
"""
api_endpoint = "/{}/data".format(nation)
api_endpoint = f"/{nation}/data"
response = self.download_data(api_endpoint)

return response.json()["data"]
Expand All @@ -96,7 +98,9 @@ def filter_soc_index(self, soc_code, nation="us"):
TYPE: Description
"""
if type(soc_code) != list and type(soc_code) != str:
raise ValueError("input `soc_code` must be one of type `list` or `str`")
raise ValueError(
"input `soc_code` must be one of type `list` or `str`",
)

if type(soc_code) == list:
payload = soc_code
Expand All @@ -112,6 +116,6 @@ def filter_soc_index(self, soc_code, nation="us"):
try:
output[soc] = index[soc]
except ValueError:
raise ValueError("`soc_code` '{}' is invalid".format(soc))
raise ValueError(f"`soc_code` '{soc}' is invalid")

return output
Loading

0 comments on commit 79cd222

Please sign in to comment.