Unable to get module to publish correctly with PyPi
up vote
2
down vote
favorite
I'm attempting to publish my module to PyPi but I'm running into troubles. It publishes, and I can install it via Pip, but I cannot seem to figure out the correct import statement to instantiate my class.
This is my setup.py
file, the code lives in discord_webhooks.py
within the same directory. Here's the published package.
from setuptools import setup, find_packages
long_description = open('README.md').read()
setup(
name='Discord Webhooks',
version='1.0.1',
packages=find_packages(exclude=['tests', 'tests.*']),
url='https://github.com/JamesIves/discord-webhooks',
author='James Ives',
author_email='iam@jamesiv.es',
description='Easy to use package for Python which allows for sending of webhooks to a Discord server.',
long_description=long_description,
license='MIT',
install_requires=[
'requests==2.20.0'
],
classifiers=[
'Programming Language :: Python :: 3'
],
)
I've attempted import DiscordWebhooks
, and from discord_webhooks import DiscordWebhooks
after doing pip install discord-webhooks
but neither seem to work. Any help would be appreciated!
python pypi
add a comment |
up vote
2
down vote
favorite
I'm attempting to publish my module to PyPi but I'm running into troubles. It publishes, and I can install it via Pip, but I cannot seem to figure out the correct import statement to instantiate my class.
This is my setup.py
file, the code lives in discord_webhooks.py
within the same directory. Here's the published package.
from setuptools import setup, find_packages
long_description = open('README.md').read()
setup(
name='Discord Webhooks',
version='1.0.1',
packages=find_packages(exclude=['tests', 'tests.*']),
url='https://github.com/JamesIves/discord-webhooks',
author='James Ives',
author_email='iam@jamesiv.es',
description='Easy to use package for Python which allows for sending of webhooks to a Discord server.',
long_description=long_description,
license='MIT',
install_requires=[
'requests==2.20.0'
],
classifiers=[
'Programming Language :: Python :: 3'
],
)
I've attempted import DiscordWebhooks
, and from discord_webhooks import DiscordWebhooks
after doing pip install discord-webhooks
but neither seem to work. Any help would be appreciated!
python pypi
From the Git repo it looks like you don't have a sub-directory for the code. I followed the directory structure used here and it worked for me: packaging.python.org/tutorials/packaging-projects
– Neil
Nov 9 at 15:22
Is there an alternative package definition for single file modules?
– James Ives
Nov 9 at 15:24
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm attempting to publish my module to PyPi but I'm running into troubles. It publishes, and I can install it via Pip, but I cannot seem to figure out the correct import statement to instantiate my class.
This is my setup.py
file, the code lives in discord_webhooks.py
within the same directory. Here's the published package.
from setuptools import setup, find_packages
long_description = open('README.md').read()
setup(
name='Discord Webhooks',
version='1.0.1',
packages=find_packages(exclude=['tests', 'tests.*']),
url='https://github.com/JamesIves/discord-webhooks',
author='James Ives',
author_email='iam@jamesiv.es',
description='Easy to use package for Python which allows for sending of webhooks to a Discord server.',
long_description=long_description,
license='MIT',
install_requires=[
'requests==2.20.0'
],
classifiers=[
'Programming Language :: Python :: 3'
],
)
I've attempted import DiscordWebhooks
, and from discord_webhooks import DiscordWebhooks
after doing pip install discord-webhooks
but neither seem to work. Any help would be appreciated!
python pypi
I'm attempting to publish my module to PyPi but I'm running into troubles. It publishes, and I can install it via Pip, but I cannot seem to figure out the correct import statement to instantiate my class.
This is my setup.py
file, the code lives in discord_webhooks.py
within the same directory. Here's the published package.
from setuptools import setup, find_packages
long_description = open('README.md').read()
setup(
name='Discord Webhooks',
version='1.0.1',
packages=find_packages(exclude=['tests', 'tests.*']),
url='https://github.com/JamesIves/discord-webhooks',
author='James Ives',
author_email='iam@jamesiv.es',
description='Easy to use package for Python which allows for sending of webhooks to a Discord server.',
long_description=long_description,
license='MIT',
install_requires=[
'requests==2.20.0'
],
classifiers=[
'Programming Language :: Python :: 3'
],
)
I've attempted import DiscordWebhooks
, and from discord_webhooks import DiscordWebhooks
after doing pip install discord-webhooks
but neither seem to work. Any help would be appreciated!
python pypi
python pypi
edited Nov 9 at 15:27
asked Nov 9 at 15:12
James Ives
1,2601331
1,2601331
From the Git repo it looks like you don't have a sub-directory for the code. I followed the directory structure used here and it worked for me: packaging.python.org/tutorials/packaging-projects
– Neil
Nov 9 at 15:22
Is there an alternative package definition for single file modules?
– James Ives
Nov 9 at 15:24
add a comment |
From the Git repo it looks like you don't have a sub-directory for the code. I followed the directory structure used here and it worked for me: packaging.python.org/tutorials/packaging-projects
– Neil
Nov 9 at 15:22
Is there an alternative package definition for single file modules?
– James Ives
Nov 9 at 15:24
From the Git repo it looks like you don't have a sub-directory for the code. I followed the directory structure used here and it worked for me: packaging.python.org/tutorials/packaging-projects
– Neil
Nov 9 at 15:22
From the Git repo it looks like you don't have a sub-directory for the code. I followed the directory structure used here and it worked for me: packaging.python.org/tutorials/packaging-projects
– Neil
Nov 9 at 15:22
Is there an alternative package definition for single file modules?
– James Ives
Nov 9 at 15:24
Is there an alternative package definition for single file modules?
– James Ives
Nov 9 at 15:24
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Managed to solve this one on my own. As this is a single file module I need to use py_modules
inside of the setup.py
file.
Here's the updated file:
from setuptools import setup, find_packages
long_description = open('README.md').read()
setup(
name='Discord Webhooks',
version='1.0.3',
py_modules=['discord_webhooks'],
url='https://github.com/JamesIves/discord-webhooks',
author='James Ives',
author_email='iam@jamesiv.es',
description='Easy to use package for Python which allows for sending of webhooks to a Discord server.',
long_description=long_description,
license='MIT',
install_requires=[
'requests==2.20.0'
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Other Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
],
)
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Managed to solve this one on my own. As this is a single file module I need to use py_modules
inside of the setup.py
file.
Here's the updated file:
from setuptools import setup, find_packages
long_description = open('README.md').read()
setup(
name='Discord Webhooks',
version='1.0.3',
py_modules=['discord_webhooks'],
url='https://github.com/JamesIves/discord-webhooks',
author='James Ives',
author_email='iam@jamesiv.es',
description='Easy to use package for Python which allows for sending of webhooks to a Discord server.',
long_description=long_description,
license='MIT',
install_requires=[
'requests==2.20.0'
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Other Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
],
)
add a comment |
up vote
1
down vote
accepted
Managed to solve this one on my own. As this is a single file module I need to use py_modules
inside of the setup.py
file.
Here's the updated file:
from setuptools import setup, find_packages
long_description = open('README.md').read()
setup(
name='Discord Webhooks',
version='1.0.3',
py_modules=['discord_webhooks'],
url='https://github.com/JamesIves/discord-webhooks',
author='James Ives',
author_email='iam@jamesiv.es',
description='Easy to use package for Python which allows for sending of webhooks to a Discord server.',
long_description=long_description,
license='MIT',
install_requires=[
'requests==2.20.0'
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Other Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
],
)
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Managed to solve this one on my own. As this is a single file module I need to use py_modules
inside of the setup.py
file.
Here's the updated file:
from setuptools import setup, find_packages
long_description = open('README.md').read()
setup(
name='Discord Webhooks',
version='1.0.3',
py_modules=['discord_webhooks'],
url='https://github.com/JamesIves/discord-webhooks',
author='James Ives',
author_email='iam@jamesiv.es',
description='Easy to use package for Python which allows for sending of webhooks to a Discord server.',
long_description=long_description,
license='MIT',
install_requires=[
'requests==2.20.0'
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Other Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
],
)
Managed to solve this one on my own. As this is a single file module I need to use py_modules
inside of the setup.py
file.
Here's the updated file:
from setuptools import setup, find_packages
long_description = open('README.md').read()
setup(
name='Discord Webhooks',
version='1.0.3',
py_modules=['discord_webhooks'],
url='https://github.com/JamesIves/discord-webhooks',
author='James Ives',
author_email='iam@jamesiv.es',
description='Easy to use package for Python which allows for sending of webhooks to a Discord server.',
long_description=long_description,
license='MIT',
install_requires=[
'requests==2.20.0'
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Other Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
],
)
answered Nov 9 at 15:45
James Ives
1,2601331
1,2601331
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53228381%2funable-to-get-module-to-publish-correctly-with-pypi%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
From the Git repo it looks like you don't have a sub-directory for the code. I followed the directory structure used here and it worked for me: packaging.python.org/tutorials/packaging-projects
– Neil
Nov 9 at 15:22
Is there an alternative package definition for single file modules?
– James Ives
Nov 9 at 15:24