Skip to content
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
4 changes: 2 additions & 2 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ Push these two commits (the one for the changelog, and the version
bump) to `origin`. Make sure you push the `v<num>` tag to `origin` as
well.

Then, build a new `sdist` package, and [upload it to
Then, build a new `sdist` package (with [build](https://pypi.org/project/build/)), and [upload it to
PyPI](https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives)
(with [twine](https://packaging.python.org/key_projects/#twine)):

```bash
rm dist/* -f
./setup.py sdist
python -m build --sdist
twine upload dist/*
```
42 changes: 42 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[build-system]
requires = ["setuptools>=61.0", "setuptools-scm[toml]>=7"]
build-backend = "setuptools.build_meta"

[project]
name = "markdown-xblock"
dynamic = ["version"]
dependencies = [
"XBlock>=5.2,<5.3",
"markdown2>=2.3.9",
"Pygments>=2.0.1",
"lxml-html-clean>=0.4.3"
]
requires-python = ">=3.11"
description = "Markdown XBlock provides editing course content in Markdown."
readme = {file = "README.md", content-type = "text/markdown"}
license = "AGPL-3.0-only"
license-files = ["LICENSE"]
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Django",
"Intended Audience :: Education",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Education",
]

[project.urls]
Repository = "https://github.com/cleura/markdown-xblock"

[project.entry-points."xblock.v1"]
markdown = "markdown_xblock:MarkdownXBlock"

[tool.setuptools_scm]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct to assume that including this section causes the package to behave the same way it would with setup(use_scm_version=True)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly.


[tool.setuptools]
packages = { find = {} }

[tool.setuptools.package-data]
markdown_xblock = [
"static/**",
"public/**"
]
59 changes: 3 additions & 56 deletions setup.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,59 +1,6 @@
"""Setup for Markdown XBlock."""

import os
#!/usr/bin/env python
"""Setup for hastexo XBlock."""

from setuptools import setup


def package_data(pkg, roots):
"""Generic function to find package_data.

All of the files under each of the `roots` will be declared as package
data for package `pkg`.

"""
data = []
for root in roots:
for dirname, _, files in os.walk(os.path.join(pkg, root)):
for fname in files:
data.append(os.path.relpath(os.path.join(dirname, fname), pkg))

return {pkg: data}


setup(
name='markdown-xblock',
use_scm_version=True,
description='Markdown XBlock provides editing course content in Markdown.',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
url='https://github.com/cleura/markdown-xblock',
license='AGPL-3.0',
classifiers=[
'Development Status :: 4 - Beta',
'Framework :: Django',
'Intended Audience :: Education',
'License :: OSI Approved :: GNU Affero General Public License v3',
'Topic :: Education :: Computer Aided Instruction (CAI)',
'Topic :: Education',
],
packages=[
'markdown_xblock',
],
python_requires='>=3.11',
install_requires=[
'XBlock>=5.2,<5.3',
'markdown2>=2.3.9',
'Pygments>=2.0.1',
'lxml-html-clean>=0.4.3'
],
setup_requires=[
'setuptools-scm',
],
entry_points={
'xblock.v1': [
'markdown = markdown_xblock:MarkdownXBlock'
]
},
package_data=package_data("markdown_xblock", ["static", "public"]),
)
setup()