Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change building installation #29

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
max-parallel: 2
matrix:
python-version: ["3.10"]
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python3 -m pip install --upgrade build twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPITOKEN }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
44 changes: 44 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project.scripts] # Change this if you want to modify the name of the executable!
pybliotecario = "pybliotecario.pybliotecario:main"

[project.urls]
repository = "https://github.com/scarlehoff/pybliotecario"

[project]
name = "pybliotecario"
dynamic = ["version"]
authors = [
{ name = "juacrumar", email = "[email protected]" }
]
description = "Personal telegram bot to interact between your Telegram account and your computer"
readme = "README"
classifiers = [
"Programming Language :: Python :: 3",
"License :: GNU GPLv3",
"Operating System :: OS Independent",
]
requires-python = ">=3.8"
dependencies = [
"requests",
"psutil"
]

[project.optional-dependencies]
facebook = ["flask", "requests_toolbelt"]
stonks = ["yahoo-fin", "pandas"]
arxiv = ["arxiv"]
weather = ["pyowm"]
wiki = ["wikipedia"]
github = ["pygithub"]
image = ["pillow"]
tests = ["numpy"]
full = ["pybliotecario[facebook, stonks, arxiv, weather, wiki, github, image, tests]"]


[tool.setuptools.dynamic]
version = {attr = "pybliotecario.__version__"}

[tool.black]
line-length = 100
skip_magic_trailing_comma = true
Expand Down
16 changes: 3 additions & 13 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ and the base program can be installed with:
pip install pybliotecario
```

If you want to install all dependencies for [all components](https://github.com/scarlehoff/pybliotecario/blob/master/setup.py#L17) do
If you want to install all dependencies for [all components](https://github.com/scarlehoff/pybliotecario/blob/master/pyproject.toml#L30) do

```bash
pip install pybliotecario[full]
Expand All @@ -31,20 +31,10 @@ You can also install it using the development version:
```bash
git clone https://github.com/scarlehoff/pybliotecario.git
cd pybliotecario
python3 setup.py install
python3 -m pip install .
```

You can use the command line argument `with_name` to install the pybliotecario
with your hostname (capitalized) as executable name.

```bash
python3 setup.py install --with_name
```

That way, for instance, if your computer is called `glados` you can invoke the program with `~$ Glados`.
If you want to use a different name just modify the variable `pybliotecario_name` inside `setup.py`.

A small `systemd_install.sh` script is included in the repository in order to daemonize it easily.
A small `systemd_install.sh` script is included in the repository in order to easily daemonize it.

## How to connect the pybliotecario to Telegram
The main backend for the pybliotecario is Telegram, although facebook can also be used (see [here](https://github.com/scarlehoff/pybliotecario/tree/master/src/pybliotecario/backend))
Expand Down
68 changes: 0 additions & 68 deletions setup.py

This file was deleted.