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

Add pyproject toml file backended with pdm manager for python >= 3.9 #126

Closed
wants to merge 9 commits into from

Conversation

stankudrow
Copy link
Contributor

@stankudrow stankudrow commented Nov 6, 2024

Greetings.

The PR targets the following major goals:

  • using pyproject.toml file as a single source for defining project metadata -> removing the setup.py script
  • introducing pdm building, packaging and dependency manager
  • declare python 3.9 a minimum version -> please refer to Python EOL dates
  • adding linters (mypy + ruff) and test (pytest) dependency groups

It covered minor goals:

  • the .gitignore got updated
  • removing some python2 details (small ones, mostly replacing xrange with range utilities)
  • adding py.typed file for mypy analysis
  • the tests directory removed from the source code and is placed alongside
  • the codec.py and types.py modules got linted and formatted with mypy and ruff packages
  • the TestData got prefixed with underscore to remove pytest warning message

Notes:

@stankudrow
Copy link
Contributor Author

@Parkayun , @Kludex , hello. Wouldn't you mind to review this PR ?

@stankudrow
Copy link
Contributor Author

@Kludex , I saw the issue #123 , would you like to have it before this PR or is there any chance to bring GHA after having this PR merged?

@stankudrow
Copy link
Contributor Author

@Kludex , https://app.travis-ci.com/github/py-bson - only bsonspec.org project is visible and no bson repository is present -> the README.rst has broken image and reference rendered incorrectly.

@stankudrow
Copy link
Contributor Author

@Parkayun , @Kludex

@stankudrow
Copy link
Contributor Author

stankudrow commented Dec 17, 2024

@Kludex , regardless the 24 files being changed, this PR is not as big as it may seem.

Let's see:

  • .gitignore - just updated according this Python template with slight changes (added ruff stuff, e.g,)
  • travis.yml - no need to support versions older than py3.9
  • pyproject.toml -> stores the project metadata, eliminates the need for setup.py and test.py scripts (all tests are gathered in a separate directory)
  • and minor changes in this test file to remove pytest warnings and this one just occasionally.

In total, only 5 files to check.

UPD: running the pyupgrade over the code did not produce any new changes.

This was referenced Dec 17, 2024
@stankudrow stankudrow marked this pull request as draft December 17, 2024 18:25
@stankudrow stankudrow mentioned this pull request Dec 19, 2024
@stankudrow
Copy link
Contributor Author

Closed in favour of the PR #133 .

@stankudrow stankudrow closed this Dec 19, 2024
@stankudrow stankudrow deleted the add-pyproject-toml-file branch December 19, 2024 13:21
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.

1 participant