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!










share|improve this question
























  • 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















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!










share|improve this question
























  • 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













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!










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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


















  • 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












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',
],
)





share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    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

























    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',
    ],
    )





    share|improve this answer

























      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',
      ],
      )





      share|improve this answer























        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',
        ],
        )





        share|improve this answer












        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',
        ],
        )






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 9 at 15:45









        James Ives

        1,2601331




        1,2601331






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Schultheiß

            Verwaltungsgliederung Dänemarks

            Liste der Kulturdenkmale in Wilsdruff