Skip to content

Commit 89ddf56

Browse files
QMasterMoopre-commit-ci[bot]
andauthoredNov 9, 2024··
feat: re-init (#3)
* new project init * pre-commit fix * delete old code * update actions * test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update readme --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 02b08f9 commit 89ddf56

File tree

12 files changed

+270
-170
lines changed

12 files changed

+270
-170
lines changed
 

‎.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SLACK_BOT_TOKEN=<token from slack>
1+
SLACK_BOT_TOKEN=<token from slack>

‎.github/workflows/linter_black.yaml

-36
This file was deleted.

‎.github/workflows/publish.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# TODO FOR THIS REPO
2+
3+
#name: Publish artifacts
4+
#
5+
#on:
6+
# push:
7+
# #branches: ['release']
8+
# branches: ['main']
9+
#
10+
#env:
11+
# REGISTRY: ghcr.io
12+
# IMAGE_NAME: ${{ github.repository }}
13+
#
14+
#jobs:
15+
# build-and-push-image:
16+
# runs-on: ubuntu-latest
17+
#
18+
# permissions:
19+
# contents: read
20+
# packages: write
21+
#
22+
# steps:
23+
# - name: Checkout repository
24+
# uses: actions/checkout@v4
25+
#
26+
# - name: Log in to the Container registry
27+
# uses: docker/login-action@v3
28+
# with:
29+
# registry: ${{ env.REGISTRY }}
30+
# username: ${{ github.actor }}
31+
# password: ${{ secrets.GITHUB_TOKEN }}
32+
#
33+
# # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
34+
# # - name: Extract metadata (tags, labels) for Docker
35+
# # id: meta
36+
# # uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
37+
# # with:
38+
# # images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39+
#
40+
# # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
41+
# # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
42+
# # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
43+
# - name: Build and push Docker image
44+
# uses: docker/build-push-action@v6
45+
# with:
46+
# context: .
47+
# push: true
48+
# #tags: ${{ steps.meta.outputs.tags }}
49+
# #labels: ${{ steps.meta.outputs.labels }}
50+
# # hardcoding while it's runnin off main
51+
# tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

‎.gitignore

+158-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,164 @@
1-
# python
2-
*.pyc
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
35

6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110+
.pdm.toml
111+
.pdm-python
112+
.pdm-build/
113+
114+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115+
__pypackages__/
116+
117+
# Celery stuff
118+
celerybeat-schedule
119+
celerybeat.pid
120+
121+
# SageMath parsed files
122+
*.sage.py
123+
124+
# Environments
4125
.env
126+
.venv
127+
env/
128+
venv/
129+
ENV/
130+
env.bak/
131+
venv.bak/
132+
133+
# Spyder project settings
134+
.spyderproject
135+
.spyproject
136+
137+
# Rope project settings
138+
.ropeproject
139+
140+
# mkdocs documentation
141+
/site
142+
143+
# mypy
144+
.mypy_cache/
145+
.dmypy.json
146+
dmypy.json
147+
148+
# Pyre type checker
149+
.pyre/
5150

6-
# auto generated idk
7-
*.egg-info
151+
# pytype static type analyzer
152+
.pytype/
8153

9-
#pyenv
10-
.python-version
154+
# Cython debug symbols
155+
cython_debug/
11156

12-
# local data
13-
local_test.py
14-
local_test_data/*
15-
local_test_output/*
157+
# PyCharm
158+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160+
# and can be added to the global gitignore or merged into this file. For a more nuclear
161+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162+
.idea/
16163

17-
# ignore pycharm stuff for now
18-
.idea
19-
.idea/*
164+
tmp/

‎.pre-commit-config.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# whale-net python pre-commit v1
2+
# See https://pre-commit.com for more information
3+
# See https://pre-commit.com/hooks.html for more hooks
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v5.0.0
7+
hooks:
8+
- id: trailing-whitespace
9+
- id: end-of-file-fixer
10+
# - id: check-yaml
11+
- id: check-added-large-files
12+
- id: mixed-line-ending
13+
args: [ --fix=lf ]
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
# Ruff version.
16+
rev: v0.7.2
17+
hooks:
18+
# Run the linter.
19+
- id: ruff
20+
args: [ --fix ]
21+
# Run the formatter.
22+
- id: ruff-format
23+
24+
ci:
25+
# should test this one day, but for now not enabling
26+
autofix_prs: false

‎.python-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

‎README.md

+7-29
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,20 @@
11
# friendly-computing-machine
22
slackbot
33

4-
54
## environment
6-
pyenv: https://github.com/pyenv/pyenv
7-
python version 3.10.7 (for now, will be configurable in future)
8-
```
9-
pyenv install 3.10.7
10-
```
11-
pyenv virtual environment: https://github.com/pyenv/pyenv-virtualenv
12-
makes package management easier for test version of python
13-
i named my environment friendly-computing-machine
14-
```
15-
pyenv virtualenv 3.10.7 friendly-computing-machine
16-
```
17-
18-
to make version management easier between different repos, create a .python-version file locally
19-
```
20-
echo 'friendly-computing-machine' > .python-version
5+
uv
216
```
22-
23-
if your bash config is setup correctly with pyenv and pyenv-virtualenv then
24-
you should be get the following
25-
```
26-
user@computer:~/friendly-computing-machine$ pyenv version
27-
friendly-computing-machine (set by /home/user/friendly-computing-machine/.python-version)
28-
```
29-
30-
run setup.py
31-
```
32-
pip install -e .
7+
uv venv
8+
source .venv/bin/activate
9+
uv sync
3310
```
3411

3512
your environment is now setup
3613

14+
(optional) update your IDE to use `./.venv/bin/python`
15+
3716
## run
3817
run the bot (or whatever this currently is)
3918
```
40-
python run.py
19+
uv run fcm
4120
```
42-

‎pyproject.toml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[project]
2+
name = "friendly-computing-machine"
3+
version = "0.1.0"
4+
description = "slackbot"
5+
readme = "README.md"
6+
authors = [
7+
{ name = "qmastermoo", email = "alex.harding@gmail.com" }
8+
]
9+
requires-python = ">=3.11"
10+
dependencies = []
11+
12+
[project.scripts]
13+
fcm = "friendly_computing_machine:main"
14+
15+
[build-system]
16+
requires = ["hatchling"]
17+
build-backend = "hatchling.build"

‎run.py

-79
This file was deleted.

‎setup.py

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def main() -> None:
2+
print("Hello from friendly-computing-machine!")

‎uv.lock

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.