Skip to content

Commit

Permalink
Merge pull request #56 from yupix/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
yupix authored Mar 13, 2023
2 parents d49c148 + 95bac09 commit 10441d4
Show file tree
Hide file tree
Showing 85 changed files with 91,181 additions and 955 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ per-file-ignores=
./mipac/__init__.py:E402,F403,F811,F401
./mipac/**/__init__.py:F403,F401
./mipac/_version.py:E501
max-line-length = 99
40 changes: 40 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contribution guide

Thank you for considering contributing to MiPAC!!!

## Issue

Check the going points before creating an assignment

- To avoid duplicates, please search for similar Issues
- Do not use Issue for questions, etc.
- We welcome your questions in GitHub Discussion or on the Discord server in the README.


## About Brunch

- `master` is a branch intended for use in a production environment
- `develop` is the branch to work on for the next release
- If you want to create a pull request, please send it to this branch

## Creating a pull request

- Create an Issue before creating a pull request.
- Please prefix the branch name with a keyword such as `feat` / `fix` / `refactor` / `chore` to identify the pull request as much as possible.
- Also, do not include changes other than to resolve the pull request issue
- If you have an Issue that will be resolved by a pull request, please include a link
- Any changes should be described in `CHANGELOG.md`. However, if there is no change from the user's point of view, there is no need to describe it.
- If possible, please use `flake8`, `mypy`, etc. to lint in your local environment.

Thank you for your cooperation.

## Notes

### About the Format

This project uses `axblack` and `isort` formatting. The difference between `axblack` and `black` is whether double or single quotes are used.

### About supported Misskey versions

- Ayuskey v5, 6
- Misskey v13, 12, 11
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: ✨ Feature Request
about: Suggest an idea
title: ''
labels: kind/Feature✨
assignees: yupix

---

## Summary

<!-- Tell us what the suggestion is -->
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Ticket link

# What's Change

<!-- a normal html comment -->

## Checklist

- [ ] Read the contribution guide
- [ ] (If needed) Update CHANGELOG.md
9 changes: 9 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'topic/API🧩':
- mipac/actions/**/*
- mipac/manager/**/*

'Manager📦':
- mipac/manager/**/*

'Actions⚙':
- mipac/actions/**/*
15 changes: 15 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

23 changes: 23 additions & 0 deletions .vscode/dev.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"create actions class": {
"prefix": "mic.actions",
"body": [
"class $1(AbstractAction):",
" def __init__(self, *, session: HTTPClient, client: ClientManager):",
" self.__session = session",
" self.__client = client",
""
],
"description": "create actions class"
},
"create manager class": {
"prefix": "mic.manager",
"body": [
"class $1(AbstractManager):",
" def __init__(self, *, session: HTTPClient, client: ClientManager):",
" self.__session: HTTPClient = session",
" self.__client: ClientManager = client"
],
"description": "create manager class"
}
}
79 changes: 78 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,86 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Added

- none
#### バージョンの自動検出機能が追加されました(β)

これはデフォルトで有効になっており、有効の間は自動的に `/api/meta` からバージョンを推論します。機能としては以下の通りです

- 11, 12, 13にヒットした場合それらにバージョンを変更する
- ヒットしなかった場合は何もしない
Misskey公式のバージョンニングを元に判断している為、独自のバージョニングを行っているフォーク等では正常に動作しない可能性があります。その際は `client.config.use_version_autodetect = False` とすることで無効にすることが可能です。また、手動でバージョンを設定する場合もoffにしてください。
一部のAPIはバージョンとフォークの種類で判断しています。そのため公式のバージョン的には使用できないが、フォークの機能として存在するという場合は報告をくださればサポートします。

- Added `role` property to `AdminManager`.
- Added `remove_none` argument to request method.
- Added method to`ClientActions` class the given below.
- `get_announcements`
- Added class the given below.
- `AdminUserActions`
- `AnnouncementCommon`
- `Announcement`
- `AnnouncementSystem`
- `IMetaAnnouncement`
- `IAnnouncementSystem`
- `AdminAnnouncementClientActions`
- `AdminAnnouncementActions`
- `AdminAnnouncementManager`
- `IModerationLog`
- `ModerationLog`
- `ServerInfoCpu`
- `ServerInfoMem`
- `ServerInfoFs`
- `ServerInfoNet`
- `ServerInfo`
- `IServerInfoCpu`
- `IServerInfoMem`
- `IServerInfoFs`
- `IServerInfoNet`
- `IServerInfo`
- `ITableStats`
- `IIndexStat`
- `IndexStat`
- `IUserIP`
- `UserIP`
- `FederationActions`
- `FederationManager`
- `IFederationInstanceStat`
- `IFederationFollowCommon`
- `IFederationFollower`
- `IFederationFollowing`
- Roles
- `IRolePolicieValue`
- `IRolePolicies`
- `IRole`
- `RolePolicyValue`
- `RolePolicies`
- `Role`
- `AdminRoleActions`
- `AdminRolesManager`
- `IRoleUser`
- `RoleUser`
- Achievements
- added `IAchievementNf` class.
- added `NotificationAchievement` class.
- added `Achievement` class.
- added `get_achievements` method at `UserActions` class.
- added `achievements` property at `UserDetailed` class.
- Note
- content field auto convert empty string to None

### Changed

- Maximum number of characters has been changed from 79 to 99
- The main reason for this change is to solve the problem that the MiPAC code is inevitably longer because of the method chain. We have kept it to the maximum of [pep8](https://peps.python.org/pep-0008/#maximum-line-length).
- Changed a method that was returning an `AsyncIterator` to return an `AsyncGenerator`.
- Generator is more correct than Iterator because it is the correct usage.
- Changed class name the given below.
- `IAnnouncement` -> `IMetaAnnouncement`
- `cache` decorator no longer uses `dynamic_args` decorator

### Removed

- Delete `dynamic_args` decorator.
- Delete debug log.

## [0.4.0] 2023-01-18

Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

<a href="https://discord.gg/CcT997U"><img src="https://img.shields.io/discord/530299114387406860?style=flat-square&color=5865f2&logo=discord&logoColor=ffffff&label=discord" alt="Discord server invite" /></a>
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-axblack-8bd124.svg"></a>
<a href="https://www.codacy.com/gh/yupix/MiPAC/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=yupix/MiPAC&amp;utm_campaign=Badge_Grade"><img src="https://app.codacy.com/project/badge/Grade/c9bf85f195f94ab58bc72ad018a2be9f"/></a>
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fyupix%2FMiPAC?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fyupix%2FMiPAC.svg?type=shield"/></a>

## 概要

MiPAのCoreとなるライブラリです。issueは[こちら](https://code.teamblackcrystal.com/projects/120/issues)で管理しています
MiPAのCoreとなるライブラリです。

MiPACはMisskey v11, 12, 13をサポートしているApi Wrapperです。
本来気にしないといけないバージョンごとのAPIの違い等を吸収してくれます。
Expand Down Expand Up @@ -42,9 +43,11 @@ if __name__ == '__main__':

- `is_official` が削除されました

##### `use_version` が追加されました
##### **重要** `use_version` が追加されました

`is_official` ではv12とv13を区別するには不十分であったため、このように変更されました。v13がリリースされたばかりというのもあり、現状のデフォルト値はv12となっています。v13をご利用の方は`use_version=13`と指定するなどして、バージョンを変更してください。
Misskeyではv11,v12,v13とバージョンがあり、バージョンによっては使用できないAPIがあったりします。MiPACでは`use_version`を指定することで事前に使用できるかどうかを確認し、使用できない場合は`NotSupportVersion`という例外を返します。このようにご自分のインスタンスのバージョンを書いていただくだけで、よくわからないエラーを事前に防ぐことが出来ます。(issue等にエラーを報告場合は必ず適切に設定されているか確認してください)

v13はまだリリースされて日が浅く、全てのインスタンスがアップデートしたとは考えにくいため、現在のデフォルト値は`12`となっています。

#### `Client` のオプションから `config`が削除されました

Expand Down
Loading

0 comments on commit 10441d4

Please sign in to comment.