Skip to content

Commit

Permalink
dependabot, a github action and requirements.txt (#3)
Browse files Browse the repository at this point in the history
* dependabot, a github action and requirements.txt

* fix the step

* fixed yaml

* fixed requirements

* flake8 will pass now
  • Loading branch information
zippy1981 authored Jan 6, 2024
1 parent ac4c18a commit 408b2ff
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
exclude =
venv/*
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/" # Monitor all Python dependencies in the repository
schedule:
interval: "daily" # Check for updates daily
open-pull-requests-limit: 10 # Limit open pull requests to 10
reviewers:
- "zippy1981" # Optional: request review from a specific user
36 changes: 36 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Python with Virtual Environment

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install dependencies
run: pip install -r requirements.txt

- name: Install linting tool
run: pip install flake8 # Install flake8 within the virtual environment

- name: Lint Python code
run: flake8 . # Lint all Python files in the current directory

- name: Run tests
run: python -m unittest
6 changes: 2 additions & 4 deletions get_display_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@

# Create a Mastodon API instance
mastodon = Mastodon(
# client_id = 'your_client_key',
# client_secret = 'your_client_secret',
access_token = settings.MASTODON_API.KEY,
api_base_url = f'https://{settings.MASTODON_API.SERVER or "mastadon.social"}'
access_token=settings.MASTODON_API.KEY,
api_base_url=f'https://{settings.MASTODON_API.SERVER or "mastadon.social"}'
)

# Get the display names
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dynaconf==3.2.4
Mastodon.py==1.8.1

0 comments on commit 408b2ff

Please sign in to comment.