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

Update day parameter in team.change_positions() to time_frame #50

Merged
merged 4 commits into from
Aug 23, 2024

Conversation

jzaturensky
Copy link
Contributor

@jzaturensky jzaturensky commented Aug 14, 2024

Position change for NFL leagues requires week rather than date, see documentation below:

image

This pull request replaces the day parameter with a more generic time_frame in the change_positions method in the Team class.
This argument may be either a datetime.date or week number for use in NFL leagues.

Copy link
Owner

@spilchen spilchen left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! I had a couple of suggestions. Can you also bump the version of the api (in setup.py) to 2.9.0?

Can you add a unit test as well?

yahoo_fantasy_api/team.py Outdated Show resolved Hide resolved
yahoo_fantasy_api/team.py Show resolved Hide resolved
@jzaturensky jzaturensky changed the title Add optional week param to team.change_positions() to use in NFL leagues Update day parameter in team.change_positions() to time_frame Aug 20, 2024
@jzaturensky jzaturensky requested a review from spilchen August 21, 2024 02:41
@jzaturensky
Copy link
Contributor Author

Seems to be an issue with the unit test framework, got the following output:

python setup.py test
c:\Users\J\test.venv\Lib\site-packages\setuptools_init_.py:85: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

    ********************************************************************************
    Requirements should be satisfied by a PEP 517 installer.
    If you are using pip, you can try `pip install --use-pep517`.
    ********************************************************************************

!!
dist.fetch_build_eggs(dist.setup_requires)
c:\Users\J\test.venv\Lib\site-packages\setuptools_distutils\dist.py:268: UserWarning: Unknown distribution option: 'tests_require'
warnings.warn(msg)
c:\users\j\test\yahoo_fantasy_api.eggs\pytest_runner-6.0.1-py3.12.egg\ptr_init_.py:81: SetuptoolsDeprecationWarning: The test command is disabled and references to it are deprecated.
!!

    ********************************************************************************
    Please remove any references to `setuptools.command.test` in all supported versions of the affected package.

    By 2024-Nov-15, you need to update your project and remove deprecated calls
    or your builds will no longer be supported.
    ********************************************************************************

!!
class PyTest(orig.test):
running pytest
Traceback (most recent call last):
File "C:\Users\J\test\yahoo_fantasy_api\setup.py", line 11, in
setup(name='yahoo_fantasy_api',
File "c:\Users\J\test.venv\Lib\site-packages\setuptools_init_.py", line 108, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\J\test.venv\Lib\site-packages\setuptools_distutils\core.py", line 184, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "c:\Users\J\test.venv\Lib\site-packages\setuptools_distutils\core.py", line 200, in run_commands
dist.run_commands()
File "c:\Users\J\test.venv\Lib\site-packages\setuptools_distutils\dist.py", line 964, in run_commands
self.run_command(cmd)
File "c:\Users\J\test.venv\Lib\site-packages\setuptools\dist.py", line 945, in run_command
super().run_command(command)
File "c:\Users\J\test.venv\Lib\site-packages\setuptools_distutils\dist.py", line 983, in run_command
cmd_obj.run()
File "c:\users\j\test\yahoo_fantasy_api.eggs\pytest_runner-6.0.1-py3.12.egg\ptr_init_.py", line 195, in run
setattr(dist, attr, getattr(self.distribution, attr))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Distribution' object has no attribute 'tests_require'. Did you mean: 'extras_require'?

@spilchen
Copy link
Owner

I'm not sure why you encountered the error when running the tests. They passed fine on my end, but I run on Linux, not Windows, so the issue might be related to the operating system.

@spilchen spilchen merged commit 86889e3 into spilchen:master Aug 23, 2024
1 check passed
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.

2 participants