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

Actions #741

Merged
merged 11 commits into from Sep 22, 2021
Merged

Actions #741

merged 11 commits into from Sep 22, 2021

Conversation

JoelLefkowitz
Copy link
Collaborator

As mentioned in #739 Travis CI is no longer running CI for free. This PR allows Github actions to run unit tests. This will allow us to continue approving PRs.

The tox environments for linters, djmaster and docs have been bound to explicit python versions rather than rely on CI environment variables for this.

The djmaster testenv until now has been allowed to fail. This is now made explicit with a tox flag. It is still a useful check as it offers diagnostic information about future compatibility.

@JoelLefkowitz
Copy link
Collaborator Author

I would like approval from at least one more frequent contributor before changing over the required checks settings.

tox.ini Outdated Show resolved Hide resolved
@johnthagen
Copy link
Collaborator

@JoelLefkowitz I left a few comments, but in general thank you for putting the time into this. This looks great.

tox.ini Outdated Show resolved Hide resolved
@JoelLefkowitz
Copy link
Collaborator Author

JoelLefkowitz commented Sep 21, 2021

I think only @axnsan12 has permission to remove the travis status check and set the github actions ones to be required.

@johnthagen
Copy link
Collaborator

In the case that @axnsan12 has this repo muted (understandable given he's mentioned he's moved on to other things), his email address can be viewed in the commit log: https://github.com/axnsan12/drf-yasg/commit/a9ec562196a697c2fbfa16ad741f53831b8ab654.patch

Might be a way to get into contact with him.

@axnsan12
Copy link
Owner

Hello, I do indeed have the repo muted 😢 but I do check on the notifications from time to time.

From what I see Travis still offers CI credits for open source projects: https://docs.travis-ci.com/user/billing-faq/#what-if-i-am-building-open-source

I could write to them to request this for drf-yasg and see how it goes.

Or, if you'd prefer to switch to actions, I can remove the Travis check and be done with it.

@johnthagen
Copy link
Collaborator

johnthagen commented Sep 22, 2021

@axnsan12 I personally think that GitHub Actions is the way forward. Most open source projects I've worked on have switched, and it's been a net benefit for the project (faster CI, the marketplace helps avoid boilerplate, etc.).

And since @JoelLefkowitz has done the hard work getting the configs switched over, I think it would be the best path forward for drf-yasg.

Or, if you'd prefer to switch to actions, I can remove the Travis check and be done with it.

I also think that if we go this path, along with removing the Travis checked, adding the GitHub Actions checks as required would also be a good move.

@axnsan12
Copy link
Owner

I think I removed the Travis check however it doesn't seem to apply retroactively...
The actions checks, like all checks that run on PRs, are required by default.

@axnsan12
Copy link
Owner

I hope you don't mind if I force merge this and see what happens.

@axnsan12 axnsan12 merged commit effc8f2 into master Sep 22, 2021
@johnthagen
Copy link
Collaborator

The actions checks, like all checks that run on PRs, are required by default.

I don't think this is correct. The checks will show up in the PR, but if they are not required, then someone with merge rights to the repo can still merge even if the GitHub Actions checks fail.

@axnsan12
Copy link
Owner

Seems the Travis removal worked 🎉 , thanks for the PR!

Looks like the GitHub ones are now required too: #730

@axnsan12
Copy link
Owner

I've also set up the PYPI_API_TOKEN secret required by the publish job.

@JoelLefkowitz
Copy link
Collaborator Author

Thanks for changing the settings @axnsan12. I'm going to label the recent bugs reported while the CI was down for a 1.20.1 release. What do you think about giving one of the frequent collaborators admin access to the repo? That way we can respond to these type of unforeseen support changes.

@johnthagen
Copy link
Collaborator

Given @JoelLefkowitz's commitment to the project, for what it's worth I would nominate he be given admin access if @axnsan12 concurs.

@axnsan12
Copy link
Owner

axnsan12 commented Sep 22, 2021

I'm not sure that's possible on a personal repo, we'd have to make an organisation to be able to have multiple owners.

Personal repos can only add "collaborators" - which both of you are.

@johnthagen
Copy link
Collaborator

@JoelLefkowitz Since you were talking about cutting a new release, it probably wouldn't hurt to also update the bundled swagger-ui / redoc that is included in this project:

drf-yasg/package.json

Lines 4 to 5 in effc8f2

"redoc": "^2.0.0-rc.40",
"swagger-ui-dist": "^3.36.0"

@tfranzel
Copy link
Contributor

@axnsan12 @johnthagen, I had to migrate from travis-ci.org to travis-ci.com a while ago, because the builds simply stopped working.

They do provide credits for OSS, but it's a painful process. You have to write a support ticket and and apply for OSS credits. That works fairly fast, but they only credit X amount at a time. Since migrating, I had to re-request credit 4-5 times. Multiple questions regarding a recurring "monthly allowance" were ignored.

@axnsan12
Copy link
Owner

Thanks for the info, but we decided to just ditch Travis in the end. Seems like that was the right choice, your experience sure does sound like a lot of hassle 😄

DavidCain added a commit to DavidCain/drf-yasg that referenced this pull request Aug 3, 2022
This commit will make sure that `Django :: 3.2` will show up in the
classifiers list on PyPI: https://pypi.org/project/drf-yasg/

(The magic happens because we parse the README to get supported Django):
https://github.com/DavidCain/drf-yasg/blob/ee29412d3cdb311/setup.py#L36

3.2 support should already exist
================================
A closed pull request, axnsan12#735,
noted support for Django 3.2 in both `tox.ini`, and the README.

That PR was closed in favor of
axnsan12#741, which edited `tox.ini`
and switched to GitHub Actions.

axnsan12#735 (comment)

This project has been testing on Django 3.2 for a long time (about a
year). I think we can declare it supported it the README!
JoelLefkowitz pushed a commit that referenced this pull request Jul 20, 2023
* Add sample code to handle Base64 fields in drf-extra-fields project

* Fix format for .rst

* Update answer to the easier version as suggested in Hipo/drf-extra-fields#66 (comment)

* update readme.rst

`permission_classes` expects tuple but list was provided

* url from DEFAULT_API_URL now works

fix a bug: url from swagger_settings.DEFAULT_API_URL is not working

* Check for allow_null attribute

* Add utf-8 support for generated formats

* Added `many` support to example code.

* serialize pytz object as a string

* simplify if condition

* handle errors rendering with TemplateHTMLRenderer

This change fixes an `OPTIONS` request to the API page which will return
a successful response, but the `TemplateHTMLRender` will not be prepared
to render it since there is no template name provided in either the view
or response [1].

[1]: https://github.com/encode/django-rest-framework/blob/f0a5b958a134e8cd94e3ef3263e8fa623ac9b82f/rest_framework/renderers.py#L178-L189

* Allow specifying response as a reference

* [readme] Fix missing re_path import

* fix map source mapping

* Remove universal wheel, python 2 is unsupported

* Inline allow_unicode parameter

* Update changelog

* Update changelog typos

* Add cspell

* Fix old spelling errors

* Add ref_name to UserSerializer after removing suffix typo

* Set permission classes to a tuple

* Update chagnelog

* Add prepublish twine check

* Fix action version syntax

* Fix indentation in README.rst code blocks

* Add twine to publish dependencies

* Specify toxenv explicitly

* Specify all tox targets

* Add py prefix to toxenvs

* Update changelog

* Update changelog

* Declare Django 3.2 support in README, classifiers

This commit will make sure that `Django :: 3.2` will show up in the
classifiers list on PyPI: https://pypi.org/project/drf-yasg/

(The magic happens because we parse the README to get supported Django):
https://github.com/DavidCain/drf-yasg/blob/ee29412d3cdb311/setup.py#L36

3.2 support should already exist
================================
A closed pull request, #735,
noted support for Django 3.2 in both `tox.ini`, and the README.

That PR was closed in favor of
#741, which edited `tox.ini`
and switched to GitHub Actions.

#735 (comment)

This project has been testing on Django 3.2 for a long time (about a
year). I think we can declare it supported it the README!

* Fix `pip install` command for contributors on zsh

On `zsh` (a popular shell, and the default for macOS), install fails:

    $ pip install -U -e .[validation]
    zsh: no matches found: .[validation]

Quote the arguments so that `bash` or `zsh` will succeed.

* Dont use NullBooleanField if drf version >= 3.14.0

* Swap back BooleanField and NullBooleanField

* Update changelog

* Update README to use path instead of re_path in example

* Run tests with latest dependencies

- Django 4.0 & 4.1
- DRF 3.13 & 3.14
- Python 3.10

* Add python 3.10 in GH actions matrix

* Fix RecursiveField

* Change github actions runner from ubuntu-latest to ubuntu-20.04

* Change github actions runner from ubuntu-latest to ubuntu-20.04

* Remove python 3.6 tests since swagger-spec-validator no longer supports it

* Use a string literal for python versions such as "3.10"

* Add python 3.10 compatibility to README.md

* Update changelog

* Fix: Provide enums support for schema.

* Fix: Tests for Python 3.11.

* Refactoring: Removed old version code.

* Fix: Linting is now working.

* Fix: Provide usage of Enums as dict keys.

* Fix: Docs build with latest sphinx versions.

* keep path parameters in their given order

* Fix: Action build docs with latest tox version.

* Fix: Update python version for dj-master branch.

Django master branch bumped minimal python version
to Python 3.10. In latest version was added check for uniq basename.

* Feature: Migrate to PyYAML for yaml generator. (#845)

* Feature: Migrate to PyYAML for yaml generator.

Closes #833

* Chore: Update swagger ui and redoc dependencies.

* Fix: Remove required coreapi dependency. (#854)

* Feature: Migrate to PyYAML for yaml generator.

Closes #833

* Chore: Update swagger ui and redoc dependencies.

* Fix: Remove required coreapi dependency.

* Update Changelog

* Feature: Add ``drf_yasg.inspectors.query.DrfAPICompatInspector``. (#857)

* Feature: Provide to override default renderers via settings.

* Feature: Enable tests for django 4.2.

* Docs: Add information how to override ``DEFAULT_SPEC_RENDERERS``.

* Feature: Add ``drf_yasg.inspectors.query.DrfAPICompatInspector``.

This inspector should be main and replace ``CoreAPICompatInspector`` in the future.

* [fix] Fixed map source mapping (#859)

* Tests: Improve test coverage 95.91% -> 98.30%. (#862)

* Update Changelog

* Add python3.6 to the actions matrix but exclude it from tests

---------

Co-authored-by: Terry <wasin.th@gmail.com>
Co-authored-by: Sumit Singh <sumit.singh4613@gmail.com>
Co-authored-by: Core-Chan <i@coreja.com>
Co-authored-by: Krista Mae Rectra <krista.rectra@gmail.com>
Co-authored-by: mmurashov <m.murashov@ritm.media>
Co-authored-by: Christoph Beckmann <cbe@colibri-media.de>
Co-authored-by: MilanPecov <mpecov@yahoo.ca>
Co-authored-by: Terence D. Honles <terence@honles.com>
Co-authored-by: Cristi Vîjdea <cristi@cvjd.me>
Co-authored-by: Max Vorobev <vmax0770@gmail.com>
Co-authored-by: Damien Ramelet <damien.ramelet@protonmail.com>
Co-authored-by: Petr Dlouhý <petr.dlouhy@email.cz>
Co-authored-by: gopackgo90 <cbodendein@live.com>
Co-authored-by: David Cain <davidjosephcain@gmail.com>
Co-authored-by: Amir Andohkosh <4315615+amir-bio@users.noreply.github.com>
Co-authored-by: Nikolaos Michas <nikos.mixas@outlook.com>
Co-authored-by: Ignacio Orlandini <ignacioorlandini@gmail.com>
Co-authored-by: Sergey Klyuykov <onegreyonewhite@mail.ru>
Co-authored-by: Gagan Deep <the.one.above.all.titan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants